From 19269b69c45c3172cd1f9663e8b25b37637524a5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 23 Oct 2026 14:58:38 +0000 Subject: [PATCH] Regenerate client from commit 0060ffa of spec repo --- .generator/schemas/v2/openapi.yaml | 901 +++++++++++++++++- .../on-call-paging/AcknowledgeOnCallPage.java | 2 +- .../v2/on-call-paging/CreateOnCallPage.java | 2 +- .../v2/on-call-paging/EscalateOnCallPage.java | 2 +- .../v2/on-call-paging/ResolveOnCallPage.java | 2 +- examples/v2/on-call/GetOnCallPage.java | 25 + examples/v2/on-call/ListOnCallPages.java | 27 + .../v2/on-call/ListOnCallPages_785978425.java | 26 + .../datadog/api/client/v2/api/OnCallApi.java | 419 ++++++++ .../api/client/v2/api/OnCallPagingApi.java | 8 +- .../model/CreateNotificationChannelData.java | 2 +- ...eateOnCallNotificationRuleRequestData.java | 2 +- .../v2/model/CreateOverrideRequestData.java | 2 +- .../v2/model/NotificationChannelData.java | 2 +- .../v2/model/NotificationChannelType.java | 2 +- ...tificationRuleChannelRelationshipData.java | 2 +- .../v2/model/OnCallNotificationRuleData.java | 2 +- .../v2/model/OnCallNotificationRuleType.java | 2 +- .../model/OnCallPageAuthorRelationship.java | 148 +++ .../OnCallPageAuthorRelationshipData.java | 176 ++++ .../api/client/v2/model/OnCallPageData.java | 241 +++++ .../v2/model/OnCallPageDataAttributes.java | 642 +++++++++++++ .../v2/model/OnCallPageDataRelationships.java | 404 ++++++++ .../client/v2/model/OnCallPageDataType.java | 53 ++ .../OnCallPageJiraIssueRelationship.java | 141 +++ .../OnCallPageJiraIssueRelationshipData.java | 180 ++++ .../v2/model/OnCallPageJiraIssueType.java | 57 ++ .../api/client/v2/model/OnCallPageLink.java | 211 ++++ .../v2/model/OnCallPageLinkAttributes.java | 285 ++++++ .../v2/model/OnCallPageLinkEntityType.java | 60 ++ .../model/OnCallPageLinkRelationshipData.java | 180 ++++ .../model/OnCallPageLinkRelationshipType.java | 81 ++ .../client/v2/model/OnCallPageLinkType.java | 53 ++ .../v2/model/OnCallPageLinksRelationship.java | 160 ++++ .../client/v2/model/OnCallPageLiveCall.java | 139 +++ .../v2/model/OnCallPageLiveCallOutcome.java | 71 ++ .../v2/model/OnCallPageLiveCallOver.java | 171 ++++ .../v2/model/OnCallPageReleaseOrigin.java | 66 ++ .../OnCallPageRespondersRelationship.java | 158 +++ .../client/v2/model/OnCallPageResponse.java | 198 ++++ .../v2/model/OnCallPageScheduledAction.java | 243 +++++ .../OnCallPageScheduledActionAttributes.java | 171 ++++ ...CallPageScheduledActionAttributesType.java | 69 ++ ...OnCallPageScheduledActionRelationship.java | 150 +++ ...llPageScheduledActionRelationshipData.java | 182 ++++ ...nCallPageScheduledActionRelationships.java | 176 ++++ ...ScheduledActionRelationshipsSchedules.java | 163 ++++ ...duledActionRelationshipsSchedulesData.java | 185 ++++ ...PageScheduledActionRelationshipsUsers.java | 162 ++++ .../model/OnCallPageScheduledActionType.java | 57 ++ ...allPageServiceNowIncidentRelationship.java | 143 +++ ...ageServiceNowIncidentRelationshipData.java | 184 ++++ .../OnCallPageServiceNowIncidentType.java | 58 ++ .../api/client/v2/model/OnCallPageStatus.java | 56 ++ .../model/OnCallPageTargetRelationship.java | 148 +++ .../OnCallPageTargetRelationshipData.java | 181 ++++ .../OnCallPageTargetRelationshipDataType.java | 64 ++ ...OnCallPageTeamRoutingRuleRelationship.java | 142 +++ ...llPageTeamRoutingRuleRelationshipData.java | 184 ++++ .../model/OnCallPageUserRelationshipData.java | 180 ++++ .../client/v2/model/OnCallPagesIncluded.java | 409 ++++++++ .../client/v2/model/OnCallPagesResponse.java | 241 +++++ .../api/client/v2/model/OnCallPagesSort.java | 70 ++ .../api/client/v2/model/OverrideData.java | 2 +- .../api/client/v2/model/OverrideDataType.java | 2 +- .../OverrideRelationshipsScheduleData.java | 2 +- ...OverrideRelationshipsScheduleDataType.java | 2 +- .../model/OverrideRelationshipsUserData.java | 2 +- .../OverrideRelationshipsUserDataType.java | 2 +- .../RoutingRuleRelationshipsPolicyData.java | 2 +- ...outingRuleRelationshipsPolicyDataType.java | 2 +- .../api/client/v2/model/Schedules.java | 2 +- .../v2/model/SchedulesResponseMeta.java | 5 +- .../v2/model/SchedulesResponseMetaPage.java | 3 +- .../api/client/v2/model/ShiftData.java | 2 +- .../model/ShiftDataRelationshipsUserData.java | 2 +- .../ShiftDataRelationshipsUserDataType.java | 2 +- .../api/client/v2/model/ShiftDataType.java | 2 +- ...gRulesDataRelationshipsRulesDataItems.java | 2 +- ...esDataRelationshipsRulesDataItemsType.java | 2 +- ...dateOnCallNotificationRuleRequestData.java | 2 +- .../datadog/api/client/v2/api/on-call.feature | 43 + .../api/client/v2/api/on-call_paging.feature | 16 +- .../com/datadog/api/client/v2/api/undo.json | 12 + .../test-runner-data/manifest.json | 21 + ...-call-page-returns-not-found-response.json | 35 + .../get-on-call-page-returns-ok-response.json | 35 + ...ist-on-call-pages-returns-ok-response.json | 35 + .../test-server-data/v2/on-call.json | 98 ++ 89 files changed, 9196 insertions(+), 62 deletions(-) create mode 100644 examples/v2/on-call/GetOnCallPage.java create mode 100644 examples/v2/on-call/ListOnCallPages.java create mode 100644 examples/v2/on-call/ListOnCallPages_785978425.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageDataRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLink.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkEntityType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLinksRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCall.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOutcome.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOver.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageReleaseOrigin.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageRespondersRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledAction.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributesType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedules.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedulesData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsUsers.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageStatus.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPageUserRelationshipData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPagesIncluded.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPagesResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OnCallPagesSort.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-not-found-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-ok-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-pages-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 96bcf5becc2..c58c0042961 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -82455,7 +82455,7 @@ components: - PUSH NotificationChannelType: default: notification_channels - description: "Indicates that the resource is of type 'notification_channels'." + description: "Indicates that the resource is of type `notification_channels`." enum: - notification_channels example: notification_channels @@ -90555,7 +90555,7 @@ components: type: object OnCallNotificationRuleType: default: notification_rules - description: "Indicates that the resource is of type 'notification_rules'." + description: "Indicates that the resource is of type `notification_rules`." enum: - notification_rules example: notification_rules @@ -90566,6 +90566,557 @@ components: description: Represents additional included resources for a on-call notification rules oneOf: - $ref: "#/components/schemas/NotificationChannelData" + OnCallPageAuthorRelationship: + description: Reference to the entity that performed an action on the page. + properties: + data: + $ref: "#/components/schemas/OnCallPageAuthorRelationshipData" + type: object + OnCallPageAuthorRelationshipData: + description: Reference to the author of a page action. + nullable: true + properties: + id: + description: The ID of the author. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + description: |- + The resource type of the author, for example `users`, `monitors`, + `incident_authors`, or `security_signal`. + example: users + type: string + required: + - id + - type + type: object + OnCallPageData: + description: An On-Call Page. + properties: + attributes: + $ref: "#/components/schemas/OnCallPageDataAttributes" + id: + description: The unique ID of the page. + example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + format: uuid + type: string + relationships: + $ref: "#/components/schemas/OnCallPageDataRelationships" + type: + $ref: "#/components/schemas/OnCallPageDataType" + required: + - id + - type + type: object + OnCallPageDataAttributes: + description: The attributes of an On-Call Page. + properties: + acknowledged_at: + description: The time when the page was first acknowledged. + example: "2026-01-01T10:05:00Z" + format: date-time + type: string + closed_at: + description: The time when the page was resolved. + example: "2026-01-01T10:30:00Z" + format: date-time + type: string + comment_count: + description: The number of comments on the page. + example: 2 + format: int64 + type: integer + created_at: + description: The time when the page was created. + example: "2026-01-01T10:00:00Z" + format: date-time + type: string + description: + description: A short summary of the issue or context. + example: Page details. + type: string + escalation_policy_uuid: + description: The ID of the escalation policy used to route the page. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + key: + description: An alternative numeric identifier of the page, as displayed in the Datadog UI. + example: "25137717" + type: string + live_call: + $ref: "#/components/schemas/OnCallPageLiveCall" + modified_at: + description: The time when the page was last modified. + example: "2026-01-01T10:30:00Z" + format: date-time + type: string + release_at: + description: The time when the snooze ends. Only set while the page is snoozed, together with `release_origin`. + example: "2026-01-01T11:00:00Z" + format: date-time + type: string + release_origin: + $ref: "#/components/schemas/OnCallPageReleaseOrigin" + responders_added_at: + description: The time when responders were first added to the page. + example: "2026-01-01T10:01:00Z" + format: date-time + type: string + services: + description: The services associated with the page. + example: + - service-a + items: + description: A service name. + type: string + type: array + status: + $ref: "#/components/schemas/OnCallPageStatus" + tags: + description: Tags associated with the page. + example: + - service:test + items: + description: A tag. + type: string + type: array + title: + description: The title of the page. + example: "Service: Test is down" + type: string + urgency: + $ref: "#/components/schemas/PageUrgency" + required: + - title + - key + - status + - description + - tags + - urgency + - created_at + type: object + OnCallPageDataRelationships: + description: The relationships of an On-Call Page. + properties: + author: + $ref: "#/components/schemas/OnCallPageAuthorRelationship" + closed_by: + $ref: "#/components/schemas/OnCallPageAuthorRelationship" + jira_issue: + $ref: "#/components/schemas/OnCallPageJiraIssueRelationship" + links: + $ref: "#/components/schemas/OnCallPageLinksRelationship" + responders: + $ref: "#/components/schemas/OnCallPageRespondersRelationship" + scheduled_action: + $ref: "#/components/schemas/OnCallPageScheduledActionRelationship" + service_now_incident: + $ref: "#/components/schemas/OnCallPageServiceNowIncidentRelationship" + target: + $ref: "#/components/schemas/OnCallPageTargetRelationship" + team_routing_rule: + $ref: "#/components/schemas/OnCallPageTeamRoutingRuleRelationship" + type: object + OnCallPageDataType: + default: pages + description: "Indicates that the resource is of type `pages`." + enum: + - pages + example: pages + type: string + x-enum-varnames: + - PAGES + OnCallPageJiraIssueRelationship: + description: The Jira issue linked to the page. + properties: + data: + $ref: "#/components/schemas/OnCallPageJiraIssueRelationshipData" + type: object + OnCallPageJiraIssueRelationshipData: + description: Reference to a Jira issue. + properties: + id: + description: The ID of the Jira issue, in the form `:`. + example: "123456:10001" + type: string + type: + $ref: "#/components/schemas/OnCallPageJiraIssueType" + required: + - id + - type + type: object + OnCallPageJiraIssueType: + default: jira_issues + description: Jira issue resource type. + enum: + - jira_issues + example: jira_issues + type: string + x-enum-varnames: + - JIRA_ISSUES + OnCallPageLink: + description: A link between a page and another Datadog resource, such as an incident. + properties: + attributes: + $ref: "#/components/schemas/OnCallPageLinkAttributes" + id: + description: The ID of the link. + example: 00000000-0000-0000-0000-000000000003 + type: string + type: + $ref: "#/components/schemas/OnCallPageLinkType" + required: + - id + - type + type: object + OnCallPageLinkAttributes: + description: |- + The attributes of a page link. A page can be the child of another Datadog resource + (for example, when an incident triggers it), or the parent of one (for example, when the + page is escalated to an incident). + properties: + child_entity_id: + description: The ID of the child resource. + example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + type: string + child_entity_type: + $ref: "#/components/schemas/OnCallPageLinkEntityType" + parent_entity_id: + description: The ID of the parent resource. + example: 00000000-0000-0000-0000-000000000002 + type: string + parent_entity_type: + $ref: "#/components/schemas/OnCallPageLinkEntityType" + relationship: + $ref: "#/components/schemas/OnCallPageLinkRelationshipType" + required: + - child_entity_id + - child_entity_type + - parent_entity_id + - parent_entity_type + - relationship + type: object + OnCallPageLinkEntityType: + description: The type of a resource linked to a page. + enum: + - case + - incident + - page + - agent_conversation + example: page + type: string + x-enum-varnames: + - CASE + - INCIDENT + - PAGE + - AGENT_CONVERSATION + OnCallPageLinkRelationshipData: + description: Reference to a page link. + properties: + id: + description: The ID of the link. + example: 00000000-0000-0000-0000-000000000003 + type: string + type: + $ref: "#/components/schemas/OnCallPageLinkType" + required: + - id + - type + type: object + OnCallPageLinkRelationshipType: + description: How the parent resource relates to the child resource. + enum: + - relates_to + - causes + - blocks + - duplicates + - parent_of + - successor_of + - escalates_to + - pages + example: pages + type: string + x-enum-varnames: + - RELATES_TO + - CAUSES + - BLOCKS + - DUPLICATES + - PARENT_OF + - SUCCESSOR_OF + - ESCALATES_TO + - PAGES + OnCallPageLinkType: + default: links + description: Page link resource type. + enum: + - links + example: links + type: string + x-enum-varnames: + - LINKS + OnCallPageLinksRelationship: + description: Links between the page and other Datadog resources, such as incidents. Always empty when listing pages. + properties: + data: + description: The list of page links. + items: + $ref: "#/components/schemas/OnCallPageLinkRelationshipData" + type: array + type: object + OnCallPageLiveCall: + description: Live call information for a page triggered by a live call route. + properties: + call_over: + $ref: "#/components/schemas/OnCallPageLiveCallOver" + type: object + OnCallPageLiveCallOutcome: + description: The outcome of a live call that has ended. + enum: + - success_call_answered + - failure_no_responder + - failure_caller_abandoned + - failure_outside_support_hours + - failure_internal_error + example: success_call_answered + type: string + x-enum-varnames: + - SUCCESS_CALL_ANSWERED + - FAILURE_NO_RESPONDER + - FAILURE_CALLER_ABANDONED + - FAILURE_OUTSIDE_SUPPORT_HOURS + - FAILURE_INTERNAL_ERROR + OnCallPageLiveCallOver: + description: Information about a live call that has ended. + properties: + outcome: + $ref: "#/components/schemas/OnCallPageLiveCallOutcome" + support_hours_start_at: + description: When support hours start, if the call was placed outside support hours. + example: "2026-01-01T09:00:00Z" + format: date-time + type: string + type: object + OnCallPageReleaseOrigin: + description: |- + What snoozed the page. Only set while the page is snoozed, together with `release_at`. + `ack_timeout`: the acknowledgment timeout. `team_rules_active_hours`: the page was + triggered outside of the active hours of the team's routing rules. `manual_snooze`: + a user snoozed the page. + enum: + - ack_timeout + - team_rules_active_hours + - manual_snooze + example: manual_snooze + type: string + x-enum-varnames: + - ACK_TIMEOUT + - TEAM_RULES_ACTIVE_HOURS + - MANUAL_SNOOZE + OnCallPageRespondersRelationship: + description: The users responding to the page. + properties: + data: + description: The list of responders. + items: + $ref: "#/components/schemas/OnCallPageUserRelationshipData" + type: array + type: object + OnCallPageResponse: + description: A single On-Call Page with its related included resources. + properties: + data: + $ref: "#/components/schemas/OnCallPageData" + included: + description: Resources related to the page, such as users, teams, scheduled actions, and links. + items: + $ref: "#/components/schemas/OnCallPagesIncluded" + type: array + required: + - data + type: object + OnCallPageScheduledAction: + description: The next action scheduled on a page, such as an escalation or an automatic resolution. + properties: + attributes: + $ref: "#/components/schemas/OnCallPageScheduledActionAttributes" + id: + description: The ID of the scheduled action. Equal to the page ID. + example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + type: string + relationships: + $ref: "#/components/schemas/OnCallPageScheduledActionRelationships" + type: + $ref: "#/components/schemas/OnCallPageScheduledActionType" + required: + - id + - type + type: object + OnCallPageScheduledActionAttributes: + description: The attributes of a scheduled action. + properties: + at: + description: The time when the action is scheduled to run. + example: "2026-01-01T10:15:00Z" + format: date-time + type: string + type: + $ref: "#/components/schemas/OnCallPageScheduledActionAttributesType" + type: object + OnCallPageScheduledActionAttributesType: + description: The kind of action that is scheduled. + enum: + - escalate + - resolve + - release + - retrigger + example: escalate + type: string + x-enum-varnames: + - ESCALATE + - RESOLVE + - RELEASE + - RETRIGGER + OnCallPageScheduledActionRelationship: + description: The next action scheduled on the page, such as an escalation. + properties: + data: + $ref: "#/components/schemas/OnCallPageScheduledActionRelationshipData" + type: object + OnCallPageScheduledActionRelationshipData: + description: Reference to the next scheduled action on the page. + nullable: true + properties: + id: + description: The ID of the scheduled action. Equal to the page ID. + example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + type: string + type: + $ref: "#/components/schemas/OnCallPageScheduledActionType" + required: + - id + - type + type: object + OnCallPageScheduledActionRelationships: + description: The relationships of a scheduled action. + properties: + schedules: + $ref: "#/components/schemas/OnCallPageScheduledActionRelationshipsSchedules" + users: + $ref: "#/components/schemas/OnCallPageScheduledActionRelationshipsUsers" + type: object + OnCallPageScheduledActionRelationshipsSchedules: + description: The schedules the action escalates to. + properties: + data: + description: The list of schedules. + items: + $ref: "#/components/schemas/OnCallPageScheduledActionRelationshipsSchedulesData" + type: array + type: object + OnCallPageScheduledActionRelationshipsSchedulesData: + description: Reference to a schedule. + properties: + id: + description: The schedule ID. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + type: + $ref: "#/components/schemas/ScheduleDataType" + required: + - id + - type + type: object + OnCallPageScheduledActionRelationshipsUsers: + description: The users the action escalates to. + properties: + data: + description: The list of users. + items: + $ref: "#/components/schemas/OnCallPageUserRelationshipData" + type: array + type: object + OnCallPageScheduledActionType: + default: scheduled_actions + description: Scheduled action resource type. + enum: + - scheduled_actions + example: scheduled_actions + type: string + x-enum-varnames: + - SCHEDULED_ACTIONS + OnCallPageServiceNowIncidentRelationship: + description: The ServiceNow incident linked to the page. + properties: + data: + $ref: "#/components/schemas/OnCallPageServiceNowIncidentRelationshipData" + type: object + OnCallPageServiceNowIncidentRelationshipData: + description: Reference to a ServiceNow incident. + properties: + id: + description: The ID of the ServiceNow incident. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/OnCallPageServiceNowIncidentType" + required: + - id + - type + type: object + OnCallPageServiceNowIncidentType: + default: service_now_incidents + description: ServiceNow incident resource type. + enum: + - service_now_incidents + example: service_now_incidents + type: string + x-enum-varnames: + - SERVICE_NOW_INCIDENTS + OnCallPageStatus: + description: The current status of the On-Call Page. + enum: + - triggered + - acknowledged + - resolved + example: triggered + type: string + x-enum-varnames: + - TRIGGERED + - ACKNOWLEDGED + - RESOLVED + OnCallPageTargetRelationship: + description: The team, user, or cross-organization handle that was paged. + properties: + data: + $ref: "#/components/schemas/OnCallPageTargetRelationshipData" + type: object + OnCallPageTargetRelationshipData: + description: Reference to the target of the page. + nullable: true + properties: + id: + description: The ID of the target. + example: 00000000-da3a-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/OnCallPageTargetRelationshipDataType" + required: + - id + - type + type: object + OnCallPageTargetRelationshipDataType: + description: The resource type of the page target. + enum: + - teams + - users + - cross_org_handles + example: teams + type: string + x-enum-varnames: + - TEAMS + - USERS + - CROSS_ORG_HANDLES OnCallPageTargetType: description: The kind of target, `team_id` | `team_handle` | `user_id`. enum: @@ -90578,6 +91129,85 @@ components: - TEAM_ID - TEAM_HANDLE - USER_ID + OnCallPageTeamRoutingRuleRelationship: + description: The team routing rule that matched the page. + properties: + data: + $ref: "#/components/schemas/OnCallPageTeamRoutingRuleRelationshipData" + type: object + OnCallPageTeamRoutingRuleRelationshipData: + description: Reference to a team routing rule. + properties: + id: + description: The ID of the team routing rule. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/TeamRoutingRulesDataRelationshipsRulesDataItemsType" + required: + - id + - type + type: object + OnCallPageUserRelationshipData: + description: Reference to a user. + properties: + id: + description: The user ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/ScheduleUserType" + required: + - id + - type + type: object + OnCallPagesIncluded: + description: A resource related to a page. + oneOf: + - $ref: "#/components/schemas/ScheduleUser" + - $ref: "#/components/schemas/TeamReference" + - $ref: "#/components/schemas/OnCallPageScheduledAction" + - $ref: "#/components/schemas/OnCallPageLink" + OnCallPagesResponse: + description: A list of On-Call Pages with pagination metadata and related included resources. + properties: + data: + description: A list of pages. + items: + $ref: "#/components/schemas/OnCallPageData" + type: array + included: + description: Resources related to the pages, such as users, teams, and scheduled actions. + items: + $ref: "#/components/schemas/OnCallPagesIncluded" + type: array + meta: + $ref: "#/components/schemas/SchedulesResponseMeta" + required: + - data + type: object + OnCallPagesSort: + default: created_at + description: Sorting options for pages. Prefix a field with `-` to sort in descending order. + enum: + - created_at + - -created_at + - modified_at + - -modified_at + - status + - -status + - priority + - -priority + type: string + x-enum-varnames: + - CREATED_AT_ASCENDING + - CREATED_AT_DESCENDING + - MODIFIED_AT_ASCENDING + - MODIFIED_AT_DESCENDING + - STATUS_ASCENDING + - STATUS_DESCENDING + - PRIORITY_ASCENDING + - PRIORITY_DESCENDING OnCallPhoneNotificationRuleMethod: description: "Specifies the method in which a phone is used in a notification rule" enum: @@ -93200,7 +93830,7 @@ components: type: object OverrideDataType: default: overrides - description: "Indicates that the resource is of type 'overrides'." + description: "Indicates that the resource is of type `overrides`." enum: - overrides example: overrides @@ -93244,7 +93874,7 @@ components: type: object OverrideRelationshipsScheduleDataType: default: schedules - description: "Indicates that the related resource is of type 'schedules'." + description: "Indicates that the related resource is of type `schedules`." enum: - schedules example: schedules @@ -93275,7 +93905,7 @@ components: type: object OverrideRelationshipsUserDataType: default: users - description: "Indicates that the related resource is of type 'users'." + description: "Indicates that the related resource is of type `users`." enum: - users example: users @@ -105287,7 +105917,7 @@ components: type: object RoutingRuleRelationshipsPolicyDataType: default: policies - description: "Indicates that the resource is of type 'policies'." + description: "Indicates that the resource is of type `policies`." enum: - policies example: policies @@ -110906,13 +111536,13 @@ components: $ref: "#/components/schemas/SchedulesResponseMeta" type: object SchedulesResponseMeta: - description: Metadata that is included in the response when listing schedules. + description: Metadata that is included in the response when listing On-Call resources. properties: page: $ref: "#/components/schemas/SchedulesResponseMetaPage" type: object SchedulesResponseMetaPage: - description: Metadata related to paging information that is included in the response when listing schedules. + description: Metadata related to pagination information that is included in the response when listing On-Call resources. properties: first_number: description: First page number. @@ -121778,7 +122408,7 @@ components: type: object ShiftDataRelationshipsUserDataType: default: users - description: "Indicates that the related resource is of type 'users'." + description: "Indicates that the related resource is of type `users`." enum: - users example: users @@ -121787,7 +122417,7 @@ components: - USERS ShiftDataType: default: shifts - description: "Indicates that the resource is of type 'shifts'." + description: "Indicates that the resource is of type `shifts`." enum: - shifts example: shifts @@ -132373,7 +133003,7 @@ components: type: object TeamRoutingRulesDataRelationshipsRulesDataItemsType: default: team_routing_rules - description: "Indicates that the resource is of type 'team_routing_rules'." + description: "Indicates that the resource is of type `team_routing_rules`." enum: - team_routing_rules example: team_routing_rules @@ -205290,6 +205920,139 @@ paths: permissions: - on_call_write /api/v2/on-call/pages: + get: + description: Retrieve a paginated list of On-Call pages, optionally filtered by a search query and sorted. + operationId: ListOnCallPages + parameters: + - description: Number of On-Call Pages to return per page of results. The maximum allowed value is 1000. + in: query + name: page[size] + required: false + schema: + default: 100 + example: 100 + format: int64 + maximum: 1000 + type: integer + - description: Page of results to return, starting at 0. `page[number]` multiplied by `page[size]` must be less than 50000. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + - description: "Search query to filter pages. Supports filters such as `status`, `urgency`, `team`, `service`, and `tags`, for example `status:triggered`." + in: query + name: filter[query] + required: false + schema: + example: "status:triggered" + type: string + - description: Sort pages by the given field. Only one field is allowed. + in: query + name: sort + required: false + schema: + $ref: "#/components/schemas/OnCallPagesSort" + responses: + "200": + content: + "application/json": + examples: + default: + value: + data: + - attributes: + created_at: "2026-01-01T10:00:00Z" + description: Page details. + key: "25137717" + status: triggered + tags: + - service:test + title: "Service: Test is down" + urgency: high + id: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + relationships: + author: + data: + id: 00000000-0000-0000-0000-000000000001 + type: users + closed_by: + data: + responders: + data: + - id: 00000000-0000-0000-0000-000000000001 + type: users + scheduled_action: + data: + target: + data: + id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: pages + included: + - attributes: + email: jane.doe@example.com + name: Jane Doe + status: active + id: 00000000-0000-0000-0000-000000000001 + type: users + - attributes: + avatar: "" + description: "" + handle: my-team + name: My Team + id: 00000000-da3a-0000-0000-000000000000 + type: teams + meta: + page: + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 100 + total: 1 + type: number_size + schema: + $ref: "#/components/schemas/OnCallPagesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: List On-Call pages + tags: + - On-Call + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + "x-permission": + operator: AND + permissions: + - on_call_read post: description: |- Trigger a new On-Call Page. @@ -205315,7 +206078,7 @@ paths: $ref: "#/components/schemas/CreatePageRequest" required: true responses: - "200": + "201": content: application/json: examples: @@ -205326,7 +206089,7 @@ paths: type: pages schema: $ref: "#/components/schemas/CreatePageResponse" - description: OK. + description: Created. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -205412,6 +206175,106 @@ paths: summary: Create On-Call Page tags: - On-Call Paging + /api/v2/on-call/pages/{page_id}: + get: + description: Get the details of an On-Call page. + operationId: GetOnCallPage + parameters: + - description: The ID of the page, or its key. + in: path + name: page_id + required: true + schema: + example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + type: string + responses: + "200": + content: + "application/json": + examples: + default: + value: + data: + attributes: + created_at: "2026-01-01T10:00:00Z" + description: Page details. + key: "25137717" + status: triggered + tags: + - service:test + title: "Service: Test is down" + urgency: high + id: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + relationships: + author: + data: + id: 00000000-0000-0000-0000-000000000001 + type: users + closed_by: + data: + links: + data: + - id: 00000000-0000-0000-0000-000000000003 + type: links + responders: + data: + - id: 00000000-0000-0000-0000-000000000001 + type: users + scheduled_action: + data: + target: + data: + id: 00000000-da3a-0000-0000-000000000000 + type: teams + type: pages + included: + - attributes: + email: jane.doe@example.com + name: Jane Doe + status: active + id: 00000000-0000-0000-0000-000000000001 + type: users + - attributes: + avatar: "" + description: "" + handle: my-team + name: My Team + id: 00000000-da3a-0000-0000-000000000000 + type: teams + - attributes: + child_entity_id: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + child_entity_type: page + parent_entity_id: 00000000-0000-0000-0000-000000000002 + parent_entity_type: case + relationship: pages + id: 00000000-0000-0000-0000-000000000003 + type: links + schema: + $ref: "#/components/schemas/OnCallPageResponse" + description: OK + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get On-Call page + tags: + - On-Call + "x-permission": + operator: AND + permissions: + - on_call_read /api/v2/on-call/pages/{page_id}/acknowledge: post: description: |- @@ -205427,8 +206290,8 @@ paths: format: uuid type: string responses: - "202": - description: Accepted. + "204": + description: No Content. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -205529,8 +206392,8 @@ paths: format: uuid type: string responses: - "202": - description: Accepted. + "204": + description: No Content. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: @@ -205631,8 +206494,8 @@ paths: format: uuid type: string responses: - "202": - description: Accepted. + "204": + description: No Content. "429": $ref: "#/components/responses/TooManyRequestsResponse" security: diff --git a/examples/v2/on-call-paging/AcknowledgeOnCallPage.java b/examples/v2/on-call-paging/AcknowledgeOnCallPage.java index 7876e6899e9..6326019f109 100644 --- a/examples/v2/on-call-paging/AcknowledgeOnCallPage.java +++ b/examples/v2/on-call-paging/AcknowledgeOnCallPage.java @@ -1,4 +1,4 @@ -// Acknowledge On-Call Page returns "Accepted." response +// Acknowledge On-Call Page returns "No Content." response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; diff --git a/examples/v2/on-call-paging/CreateOnCallPage.java b/examples/v2/on-call-paging/CreateOnCallPage.java index d3bb8831481..baf9d493def 100644 --- a/examples/v2/on-call-paging/CreateOnCallPage.java +++ b/examples/v2/on-call-paging/CreateOnCallPage.java @@ -1,4 +1,4 @@ -// Create On-Call Page returns "OK." response +// Create On-Call Page returns "Created." response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; diff --git a/examples/v2/on-call-paging/EscalateOnCallPage.java b/examples/v2/on-call-paging/EscalateOnCallPage.java index 4d1d0d4d3d4..717908c0f13 100644 --- a/examples/v2/on-call-paging/EscalateOnCallPage.java +++ b/examples/v2/on-call-paging/EscalateOnCallPage.java @@ -1,4 +1,4 @@ -// Escalate On-Call Page returns "Accepted." response +// Escalate On-Call Page returns "No Content." response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; diff --git a/examples/v2/on-call-paging/ResolveOnCallPage.java b/examples/v2/on-call-paging/ResolveOnCallPage.java index 71f4f7243a2..152d78fbc33 100644 --- a/examples/v2/on-call-paging/ResolveOnCallPage.java +++ b/examples/v2/on-call-paging/ResolveOnCallPage.java @@ -1,4 +1,4 @@ -// Resolve On-Call Page returns "Accepted." response +// Resolve On-Call Page returns "No Content." response import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; diff --git a/examples/v2/on-call/GetOnCallPage.java b/examples/v2/on-call/GetOnCallPage.java new file mode 100644 index 00000000000..7fd58e55a37 --- /dev/null +++ b/examples/v2/on-call/GetOnCallPage.java @@ -0,0 +1,25 @@ +// Get On-Call page returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OnCallApi; +import com.datadog.api.client.v2.model.OnCallPageResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + try { + OnCallPageResponse result = apiInstance.getOnCallPage("f63eb677-07ce-46ab-b2e0-80ca1ffe91bf"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallApi#getOnCallPage"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/on-call/ListOnCallPages.java b/examples/v2/on-call/ListOnCallPages.java new file mode 100644 index 00000000000..08d7cf4b2aa --- /dev/null +++ b/examples/v2/on-call/ListOnCallPages.java @@ -0,0 +1,27 @@ +// List On-Call pages returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OnCallApi; +import com.datadog.api.client.v2.api.OnCallApi.ListOnCallPagesOptionalParameters; +import com.datadog.api.client.v2.model.OnCallPagesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + try { + OnCallPagesResponse result = + apiInstance.listOnCallPages(new ListOnCallPagesOptionalParameters().filterQuery("key:1")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OnCallApi#listOnCallPages"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/on-call/ListOnCallPages_785978425.java b/examples/v2/on-call/ListOnCallPages_785978425.java new file mode 100644 index 00000000000..6742fa14d00 --- /dev/null +++ b/examples/v2/on-call/ListOnCallPages_785978425.java @@ -0,0 +1,26 @@ +// List On-Call pages returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.OnCallApi; +import com.datadog.api.client.v2.model.OnCallPageData; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + OnCallApi apiInstance = new OnCallApi(defaultClient); + + try { + PaginationIterable iterable = apiInstance.listOnCallPagesWithPagination(); + + for (OnCallPageData item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling OnCallApi#listOnCallPagesWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java b/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java index 698a1ec92dc..6412eda7f3c 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OnCallApi.java @@ -17,6 +17,10 @@ import com.datadog.api.client.v2.model.ListOnCallNotificationRulesResponse; import com.datadog.api.client.v2.model.NotificationChannel; import com.datadog.api.client.v2.model.OnCallNotificationRule; +import com.datadog.api.client.v2.model.OnCallPageData; +import com.datadog.api.client.v2.model.OnCallPageResponse; +import com.datadog.api.client.v2.model.OnCallPagesResponse; +import com.datadog.api.client.v2.model.OnCallPagesSort; import com.datadog.api.client.v2.model.OverrideCreateResponse; import com.datadog.api.client.v2.model.OverrideData; import com.datadog.api.client.v2.model.Overrides; @@ -1999,6 +2003,142 @@ public ApiResponse getOnCallEscalationPolicyWithHttpInfo( new GenericType() {}); } + /** + * Get On-Call page. + * + *

See {@link #getOnCallPageWithHttpInfo}. + * + * @param pageId The ID of the page, or its key. (required) + * @return OnCallPageResponse + * @throws ApiException if fails to make API call + */ + public OnCallPageResponse getOnCallPage(String pageId) throws ApiException { + return getOnCallPageWithHttpInfo(pageId).getData(); + } + + /** + * Get On-Call page. + * + *

See {@link #getOnCallPageWithHttpInfoAsync}. + * + * @param pageId The ID of the page, or its key. (required) + * @return CompletableFuture<OnCallPageResponse> + */ + public CompletableFuture getOnCallPageAsync(String pageId) { + return getOnCallPageWithHttpInfoAsync(pageId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of an On-Call page. + * + * @param pageId The ID of the page, or its key. (required) + * @return ApiResponse<OnCallPageResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getOnCallPageWithHttpInfo(String pageId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pageId' is set + if (pageId == null) { + throw new ApiException( + 400, "Missing the required parameter 'pageId' when calling getOnCallPage"); + } + // create path and map variables + String localVarPath = + "/api/v2/on-call/pages/{page_id}" + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OnCallApi.getOnCallPage", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get On-Call page. + * + *

See {@link #getOnCallPageWithHttpInfo}. + * + * @param pageId The ID of the page, or its key. (required) + * @return CompletableFuture<ApiResponse<OnCallPageResponse>> + */ + public CompletableFuture> getOnCallPageWithHttpInfoAsync( + String pageId) { + Object localVarPostBody = null; + + // verify the required parameter 'pageId' is set + if (pageId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'pageId' when calling getOnCallPage")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/on-call/pages/{page_id}" + .replaceAll("\\{" + "page_id" + "\\}", apiClient.escapeString(pageId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OnCallApi.getOnCallPage", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to getOnCallSchedule. */ public static class GetOnCallScheduleOptionalParameters { private String include; @@ -3852,6 +3992,285 @@ public ApiResponse listOnCallEscalationPoliciesWithHttpInfo( new GenericType() {}); } + /** Manage optional parameters to listOnCallPages. */ + public static class ListOnCallPagesOptionalParameters { + private Long pageSize; + private Long pageNumber; + private String filterQuery; + private OnCallPagesSort sort; + + /** + * Set pageSize. + * + * @param pageSize Number of On-Call Pages to return per page of results. The maximum allowed + * value is 1000. (optional, default to 100) + * @return ListOnCallPagesOptionalParameters + */ + public ListOnCallPagesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Page of results to return, starting at 0. page[number] + * multiplied by page[size] must be less than 50000. (optional, default to 0) + * @return ListOnCallPagesOptionalParameters + */ + public ListOnCallPagesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterQuery. + * + * @param filterQuery Search query to filter pages. Supports filters such as status + * , urgency, team, service, and tags, + * for example status:triggered. (optional) + * @return ListOnCallPagesOptionalParameters + */ + public ListOnCallPagesOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * Set sort. + * + * @param sort Sort pages by the given field. Only one field is allowed. (optional, default to + * "created_at") + * @return ListOnCallPagesOptionalParameters + */ + public ListOnCallPagesOptionalParameters sort(OnCallPagesSort sort) { + this.sort = sort; + return this; + } + } + + /** + * List On-Call pages. + * + *

See {@link #listOnCallPagesWithHttpInfo}. + * + * @return OnCallPagesResponse + * @throws ApiException if fails to make API call + */ + public OnCallPagesResponse listOnCallPages() throws ApiException { + return listOnCallPagesWithHttpInfo(new ListOnCallPagesOptionalParameters()).getData(); + } + + /** + * List On-Call pages. + * + *

See {@link #listOnCallPagesWithHttpInfoAsync}. + * + * @return CompletableFuture<OnCallPagesResponse> + */ + public CompletableFuture listOnCallPagesAsync() { + return listOnCallPagesWithHttpInfoAsync(new ListOnCallPagesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List On-Call pages. + * + *

See {@link #listOnCallPagesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return OnCallPagesResponse + * @throws ApiException if fails to make API call + */ + public OnCallPagesResponse listOnCallPages(ListOnCallPagesOptionalParameters parameters) + throws ApiException { + return listOnCallPagesWithHttpInfo(parameters).getData(); + } + + /** + * List On-Call pages. + * + *

See {@link #listOnCallPagesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<OnCallPagesResponse> + */ + public CompletableFuture listOnCallPagesAsync( + ListOnCallPagesOptionalParameters parameters) { + return listOnCallPagesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List On-Call pages. + * + *

See {@link #listOnCallPagesWithHttpInfo}. + * + * @return PaginationIterable<OnCallPageData> + */ + public PaginationIterable listOnCallPagesWithPagination() { + ListOnCallPagesOptionalParameters parameters = new ListOnCallPagesOptionalParameters(); + return listOnCallPagesWithPagination(parameters); + } + + /** + * List On-Call pages. + * + *

See {@link #listOnCallPagesWithHttpInfo}. + * + * @return OnCallPagesResponse + */ + public PaginationIterable listOnCallPagesWithPagination( + ListOnCallPagesOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageNumber"; + Boolean valueSetterParamOptional = true; + parameters.pageNumber(0l); + Long limit; + + if (parameters.pageSize == null) { + limit = 100l; + parameters.pageSize(limit); + } else { + limit = parameters.pageSize; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listOnCallPages", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + false, + false, + limit, + args, + 0); + + return iterator; + } + + /** + * Retrieve a paginated list of On-Call pages, optionally filtered by a search query and sorted. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<OnCallPagesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listOnCallPagesWithHttpInfo( + ListOnCallPagesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterQuery = parameters.filterQuery; + OnCallPagesSort sort = parameters.sort; + // create path and map variables + String localVarPath = "/api/v2/on-call/pages"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OnCallApi.listOnCallPages", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List On-Call pages. + * + *

See {@link #listOnCallPagesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<OnCallPagesResponse>> + */ + public CompletableFuture> listOnCallPagesWithHttpInfoAsync( + ListOnCallPagesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterQuery = parameters.filterQuery; + OnCallPagesSort sort = parameters.sort; + // create path and map variables + String localVarPath = "/api/v2/on-call/pages"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OnCallApi.listOnCallPages", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to listOnCallSchedules. */ public static class ListOnCallSchedulesOptionalParameters { private Long pageSize; diff --git a/src/main/java/com/datadog/api/client/v2/api/OnCallPagingApi.java b/src/main/java/com/datadog/api/client/v2/api/OnCallPagingApi.java index fc7a11299a0..e7b56bcdb85 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OnCallPagingApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OnCallPagingApi.java @@ -83,7 +83,7 @@ public CompletableFuture acknowledgeOnCallPageAsync(UUID pageId) { * * * - * + * * *
Response details
Status Code Description Response Headers
202 Accepted. -
204 No Content. -
429 Too many requests -
*/ @@ -214,7 +214,7 @@ public CompletableFuture createOnCallPageAsync(CreatePageReq * * * - * + * * *
Response details
Status Code Description Response Headers
200 OK. -
201 Created. -
429 Too many requests -
*/ @@ -342,7 +342,7 @@ public CompletableFuture escalateOnCallPageAsync(UUID pageId) { * * * - * + * * *
Response details
Status Code Description Response Headers
202 Accepted. -
204 No Content. -
429 Too many requests -
*/ @@ -472,7 +472,7 @@ public CompletableFuture resolveOnCallPageAsync(UUID pageId) { * * * - * + * * *
Response details
Status Code Description Response Headers
202 Accepted. -
204 No Content. -
429 Too many requests -
*/ diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateNotificationChannelData.java b/src/main/java/com/datadog/api/client/v2/model/CreateNotificationChannelData.java index a905a36dbba..4c8391429b0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateNotificationChannelData.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateNotificationChannelData.java @@ -73,7 +73,7 @@ public CreateNotificationChannelData type(NotificationChannelType type) { } /** - * Indicates that the resource is of type 'notification_channels'. + * Indicates that the resource is of type notification_channels. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateOnCallNotificationRuleRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateOnCallNotificationRuleRequestData.java index aca0a82b2a2..3c6c6aa1b97 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateOnCallNotificationRuleRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateOnCallNotificationRuleRequestData.java @@ -104,7 +104,7 @@ public CreateOnCallNotificationRuleRequestData type(OnCallNotificationRuleType t } /** - * Indicates that the resource is of type 'notification_rules'. + * Indicates that the resource is of type notification_rules. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateOverrideRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateOverrideRequestData.java index b411c3b7a59..27c9f1abe98 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateOverrideRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateOverrideRequestData.java @@ -105,7 +105,7 @@ public CreateOverrideRequestData type(OverrideDataType type) { } /** - * Indicates that the resource is of type 'overrides'. + * Indicates that the resource is of type overrides. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationChannelData.java b/src/main/java/com/datadog/api/client/v2/model/NotificationChannelData.java index 49801e30b64..20d6e57ed40 100644 --- a/src/main/java/com/datadog/api/client/v2/model/NotificationChannelData.java +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationChannelData.java @@ -98,7 +98,7 @@ public NotificationChannelData type(NotificationChannelType type) { } /** - * Indicates that the resource is of type 'notification_channels'. + * Indicates that the resource is of type notification_channels. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/NotificationChannelType.java b/src/main/java/com/datadog/api/client/v2/model/NotificationChannelType.java index 05e2ad0ed5f..2c01a4f01f2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/NotificationChannelType.java +++ b/src/main/java/com/datadog/api/client/v2/model/NotificationChannelType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the resource is of type 'notification_channels'. */ +/** Indicates that the resource is of type notification_channels. */ @JsonSerialize(using = NotificationChannelType.NotificationChannelTypeSerializer.class) public class NotificationChannelType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleChannelRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleChannelRelationshipData.java index d29b66e506e..edfcbb602d5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleChannelRelationshipData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleChannelRelationshipData.java @@ -59,7 +59,7 @@ public OnCallNotificationRuleChannelRelationshipData type(NotificationChannelTyp } /** - * Indicates that the resource is of type 'notification_channels'. + * Indicates that the resource is of type notification_channels. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleData.java index 4cb8873b443..fdc673b0185 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleData.java @@ -128,7 +128,7 @@ public OnCallNotificationRuleData type(OnCallNotificationRuleType type) { } /** - * Indicates that the resource is of type 'notification_rules'. + * Indicates that the resource is of type notification_rules. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleType.java index b765ae97df1..2003bb24c16 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleType.java +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallNotificationRuleType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the resource is of type 'notification_rules'. */ +/** Indicates that the resource is of type notification_rules. */ @JsonSerialize(using = OnCallNotificationRuleType.OnCallNotificationRuleTypeSerializer.class) public class OnCallNotificationRuleType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationship.java new file mode 100644 index 00000000000..c2a664f43a9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationship.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Reference to the entity that performed an action on the page. */ +@JsonPropertyOrder({OnCallPageAuthorRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageAuthorRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private JsonNullable data = + JsonNullable.undefined(); + + public OnCallPageAuthorRelationship data(OnCallPageAuthorRelationshipData data) { + this.data = JsonNullable.of(data); + return this; + } + + /** + * Reference to the author of a page action. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OnCallPageAuthorRelationshipData getData() { + return data.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable data) { + this.data = data; + } + + public void setData(OnCallPageAuthorRelationshipData data) { + this.data = JsonNullable.of(data); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageAuthorRelationship + */ + @JsonAnySetter + public OnCallPageAuthorRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageAuthorRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageAuthorRelationship onCallPageAuthorRelationship = (OnCallPageAuthorRelationship) o; + return Objects.equals(this.data, onCallPageAuthorRelationship.data) + && Objects.equals( + this.additionalProperties, onCallPageAuthorRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageAuthorRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationshipData.java new file mode 100644 index 00000000000..5c0fabed86b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageAuthorRelationshipData.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to the author of a page action. */ +@JsonPropertyOrder({ + OnCallPageAuthorRelationshipData.JSON_PROPERTY_ID, + OnCallPageAuthorRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageAuthorRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public OnCallPageAuthorRelationshipData() {} + + @JsonCreator + public OnCallPageAuthorRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public OnCallPageAuthorRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the author. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageAuthorRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * The resource type of the author, for example users, monitors, + * incident_authors, or security_signal. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageAuthorRelationshipData + */ + @JsonAnySetter + public OnCallPageAuthorRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageAuthorRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageAuthorRelationshipData onCallPageAuthorRelationshipData = + (OnCallPageAuthorRelationshipData) o; + return Objects.equals(this.id, onCallPageAuthorRelationshipData.id) + && Objects.equals(this.type, onCallPageAuthorRelationshipData.type) + && Objects.equals( + this.additionalProperties, onCallPageAuthorRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageAuthorRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageData.java new file mode 100644 index 00000000000..eda81663a6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageData.java @@ -0,0 +1,241 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** An On-Call Page. */ +@JsonPropertyOrder({ + OnCallPageData.JSON_PROPERTY_ATTRIBUTES, + OnCallPageData.JSON_PROPERTY_ID, + OnCallPageData.JSON_PROPERTY_RELATIONSHIPS, + OnCallPageData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OnCallPageDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private OnCallPageDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageDataType type = OnCallPageDataType.PAGES; + + public OnCallPageData() {} + + @JsonCreator + public OnCallPageData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OnCallPageDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageData attributes(OnCallPageDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of an On-Call Page. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OnCallPageDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public OnCallPageData id(UUID id) { + this.id = id; + return this; + } + + /** + * The unique ID of the page. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public OnCallPageData relationships(OnCallPageDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * The relationships of an On-Call Page. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(OnCallPageDataRelationships relationships) { + this.relationships = relationships; + if (relationships != null) { + this.unparsed |= relationships.unparsed; + } + } + + public OnCallPageData type(OnCallPageDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Indicates that the resource is of type pages. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageDataType getType() { + return type; + } + + public void setType(OnCallPageDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageData + */ + @JsonAnySetter + public OnCallPageData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageData onCallPageData = (OnCallPageData) o; + return Objects.equals(this.attributes, onCallPageData.attributes) + && Objects.equals(this.id, onCallPageData.id) + && Objects.equals(this.relationships, onCallPageData.relationships) + && Objects.equals(this.type, onCallPageData.type) + && Objects.equals(this.additionalProperties, onCallPageData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataAttributes.java new file mode 100644 index 00000000000..a0e3506cec4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataAttributes.java @@ -0,0 +1,642 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** The attributes of an On-Call Page. */ +@JsonPropertyOrder({ + OnCallPageDataAttributes.JSON_PROPERTY_ACKNOWLEDGED_AT, + OnCallPageDataAttributes.JSON_PROPERTY_CLOSED_AT, + OnCallPageDataAttributes.JSON_PROPERTY_COMMENT_COUNT, + OnCallPageDataAttributes.JSON_PROPERTY_CREATED_AT, + OnCallPageDataAttributes.JSON_PROPERTY_DESCRIPTION, + OnCallPageDataAttributes.JSON_PROPERTY_ESCALATION_POLICY_UUID, + OnCallPageDataAttributes.JSON_PROPERTY_KEY, + OnCallPageDataAttributes.JSON_PROPERTY_LIVE_CALL, + OnCallPageDataAttributes.JSON_PROPERTY_MODIFIED_AT, + OnCallPageDataAttributes.JSON_PROPERTY_RELEASE_AT, + OnCallPageDataAttributes.JSON_PROPERTY_RELEASE_ORIGIN, + OnCallPageDataAttributes.JSON_PROPERTY_RESPONDERS_ADDED_AT, + OnCallPageDataAttributes.JSON_PROPERTY_SERVICES, + OnCallPageDataAttributes.JSON_PROPERTY_STATUS, + OnCallPageDataAttributes.JSON_PROPERTY_TAGS, + OnCallPageDataAttributes.JSON_PROPERTY_TITLE, + OnCallPageDataAttributes.JSON_PROPERTY_URGENCY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; + private OffsetDateTime acknowledgedAt; + + public static final String JSON_PROPERTY_CLOSED_AT = "closed_at"; + private OffsetDateTime closedAt; + + public static final String JSON_PROPERTY_COMMENT_COUNT = "comment_count"; + private Long commentCount; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_ESCALATION_POLICY_UUID = "escalation_policy_uuid"; + private UUID escalationPolicyUuid; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_LIVE_CALL = "live_call"; + private OnCallPageLiveCall liveCall; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_RELEASE_AT = "release_at"; + private OffsetDateTime releaseAt; + + public static final String JSON_PROPERTY_RELEASE_ORIGIN = "release_origin"; + private OnCallPageReleaseOrigin releaseOrigin; + + public static final String JSON_PROPERTY_RESPONDERS_ADDED_AT = "responders_added_at"; + private OffsetDateTime respondersAddedAt; + + public static final String JSON_PROPERTY_SERVICES = "services"; + private List services = null; + + public static final String JSON_PROPERTY_STATUS = "status"; + private OnCallPageStatus status; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_URGENCY = "urgency"; + private PageUrgency urgency = PageUrgency.HIGH; + + public OnCallPageDataAttributes() {} + + @JsonCreator + public OnCallPageDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_KEY) String key, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) OnCallPageStatus status, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_URGENCY) PageUrgency urgency) { + this.createdAt = createdAt; + this.description = description; + this.key = key; + this.status = status; + this.unparsed |= !status.isValid(); + this.tags = tags; + this.title = title; + this.urgency = urgency; + this.unparsed |= !urgency.isValid(); + } + + public OnCallPageDataAttributes acknowledgedAt(OffsetDateTime acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + return this; + } + + /** + * The time when the page was first acknowledged. + * + * @return acknowledgedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACKNOWLEDGED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getAcknowledgedAt() { + return acknowledgedAt; + } + + public void setAcknowledgedAt(OffsetDateTime acknowledgedAt) { + this.acknowledgedAt = acknowledgedAt; + } + + public OnCallPageDataAttributes closedAt(OffsetDateTime closedAt) { + this.closedAt = closedAt; + return this; + } + + /** + * The time when the page was resolved. + * + * @return closedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOSED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getClosedAt() { + return closedAt; + } + + public void setClosedAt(OffsetDateTime closedAt) { + this.closedAt = closedAt; + } + + public OnCallPageDataAttributes commentCount(Long commentCount) { + this.commentCount = commentCount; + return this; + } + + /** + * The number of comments on the page. + * + * @return commentCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCommentCount() { + return commentCount; + } + + public void setCommentCount(Long commentCount) { + this.commentCount = commentCount; + } + + public OnCallPageDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The time when the page was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public OnCallPageDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A short summary of the issue or context. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public OnCallPageDataAttributes escalationPolicyUuid(UUID escalationPolicyUuid) { + this.escalationPolicyUuid = escalationPolicyUuid; + return this; + } + + /** + * The ID of the escalation policy used to route the page. + * + * @return escalationPolicyUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ESCALATION_POLICY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getEscalationPolicyUuid() { + return escalationPolicyUuid; + } + + public void setEscalationPolicyUuid(UUID escalationPolicyUuid) { + this.escalationPolicyUuid = escalationPolicyUuid; + } + + public OnCallPageDataAttributes key(String key) { + this.key = key; + return this; + } + + /** + * An alternative numeric identifier of the page, as displayed in the Datadog UI. + * + * @return key + */ + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public OnCallPageDataAttributes liveCall(OnCallPageLiveCall liveCall) { + this.liveCall = liveCall; + this.unparsed |= liveCall.unparsed; + return this; + } + + /** + * Live call information for a page triggered by a live call route. + * + * @return liveCall + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIVE_CALL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageLiveCall getLiveCall() { + return liveCall; + } + + public void setLiveCall(OnCallPageLiveCall liveCall) { + this.liveCall = liveCall; + if (liveCall != null) { + this.unparsed |= liveCall.unparsed; + } + } + + public OnCallPageDataAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The time when the page was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public OnCallPageDataAttributes releaseAt(OffsetDateTime releaseAt) { + this.releaseAt = releaseAt; + return this; + } + + /** + * The time when the snooze ends. Only set while the page is snoozed, together with + * release_origin. + * + * @return releaseAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELEASE_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getReleaseAt() { + return releaseAt; + } + + public void setReleaseAt(OffsetDateTime releaseAt) { + this.releaseAt = releaseAt; + } + + public OnCallPageDataAttributes releaseOrigin(OnCallPageReleaseOrigin releaseOrigin) { + this.releaseOrigin = releaseOrigin; + this.unparsed |= !releaseOrigin.isValid(); + return this; + } + + /** + * What snoozed the page. Only set while the page is snoozed, together with release_at + * . ack_timeout: the acknowledgment timeout. team_rules_active_hours + * : the page was triggered outside of the active hours of the team's routing rules. + * manual_snooze: a user snoozed the page. + * + * @return releaseOrigin + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELEASE_ORIGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageReleaseOrigin getReleaseOrigin() { + return releaseOrigin; + } + + public void setReleaseOrigin(OnCallPageReleaseOrigin releaseOrigin) { + if (!releaseOrigin.isValid()) { + this.unparsed = true; + } + this.releaseOrigin = releaseOrigin; + } + + public OnCallPageDataAttributes respondersAddedAt(OffsetDateTime respondersAddedAt) { + this.respondersAddedAt = respondersAddedAt; + return this; + } + + /** + * The time when responders were first added to the page. + * + * @return respondersAddedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONDERS_ADDED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getRespondersAddedAt() { + return respondersAddedAt; + } + + public void setRespondersAddedAt(OffsetDateTime respondersAddedAt) { + this.respondersAddedAt = respondersAddedAt; + } + + public OnCallPageDataAttributes services(List services) { + this.services = services; + return this; + } + + public OnCallPageDataAttributes addServicesItem(String servicesItem) { + if (this.services == null) { + this.services = new ArrayList<>(); + } + this.services.add(servicesItem); + return this; + } + + /** + * The services associated with the page. + * + * @return services + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getServices() { + return services; + } + + public void setServices(List services) { + this.services = services; + } + + public OnCallPageDataAttributes status(OnCallPageStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The current status of the On-Call Page. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageStatus getStatus() { + return status; + } + + public void setStatus(OnCallPageStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public OnCallPageDataAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public OnCallPageDataAttributes addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * Tags associated with the page. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public OnCallPageDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the page. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public OnCallPageDataAttributes urgency(PageUrgency urgency) { + this.urgency = urgency; + this.unparsed |= !urgency.isValid(); + return this; + } + + /** + * On-Call Page urgency level. + * + * @return urgency + */ + @JsonProperty(JSON_PROPERTY_URGENCY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PageUrgency getUrgency() { + return urgency; + } + + public void setUrgency(PageUrgency urgency) { + if (!urgency.isValid()) { + this.unparsed = true; + } + this.urgency = urgency; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageDataAttributes + */ + @JsonAnySetter + public OnCallPageDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageDataAttributes onCallPageDataAttributes = (OnCallPageDataAttributes) o; + return Objects.equals(this.acknowledgedAt, onCallPageDataAttributes.acknowledgedAt) + && Objects.equals(this.closedAt, onCallPageDataAttributes.closedAt) + && Objects.equals(this.commentCount, onCallPageDataAttributes.commentCount) + && Objects.equals(this.createdAt, onCallPageDataAttributes.createdAt) + && Objects.equals(this.description, onCallPageDataAttributes.description) + && Objects.equals(this.escalationPolicyUuid, onCallPageDataAttributes.escalationPolicyUuid) + && Objects.equals(this.key, onCallPageDataAttributes.key) + && Objects.equals(this.liveCall, onCallPageDataAttributes.liveCall) + && Objects.equals(this.modifiedAt, onCallPageDataAttributes.modifiedAt) + && Objects.equals(this.releaseAt, onCallPageDataAttributes.releaseAt) + && Objects.equals(this.releaseOrigin, onCallPageDataAttributes.releaseOrigin) + && Objects.equals(this.respondersAddedAt, onCallPageDataAttributes.respondersAddedAt) + && Objects.equals(this.services, onCallPageDataAttributes.services) + && Objects.equals(this.status, onCallPageDataAttributes.status) + && Objects.equals(this.tags, onCallPageDataAttributes.tags) + && Objects.equals(this.title, onCallPageDataAttributes.title) + && Objects.equals(this.urgency, onCallPageDataAttributes.urgency) + && Objects.equals(this.additionalProperties, onCallPageDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + acknowledgedAt, + closedAt, + commentCount, + createdAt, + description, + escalationPolicyUuid, + key, + liveCall, + modifiedAt, + releaseAt, + releaseOrigin, + respondersAddedAt, + services, + status, + tags, + title, + urgency, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageDataAttributes {\n"); + sb.append(" acknowledgedAt: ").append(toIndentedString(acknowledgedAt)).append("\n"); + sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n"); + sb.append(" commentCount: ").append(toIndentedString(commentCount)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" escalationPolicyUuid: ") + .append(toIndentedString(escalationPolicyUuid)) + .append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" liveCall: ").append(toIndentedString(liveCall)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" releaseAt: ").append(toIndentedString(releaseAt)).append("\n"); + sb.append(" releaseOrigin: ").append(toIndentedString(releaseOrigin)).append("\n"); + sb.append(" respondersAddedAt: ").append(toIndentedString(respondersAddedAt)).append("\n"); + sb.append(" services: ").append(toIndentedString(services)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" urgency: ").append(toIndentedString(urgency)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataRelationships.java new file mode 100644 index 00000000000..6edd45ad320 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataRelationships.java @@ -0,0 +1,404 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The relationships of an On-Call Page. */ +@JsonPropertyOrder({ + OnCallPageDataRelationships.JSON_PROPERTY_AUTHOR, + OnCallPageDataRelationships.JSON_PROPERTY_CLOSED_BY, + OnCallPageDataRelationships.JSON_PROPERTY_JIRA_ISSUE, + OnCallPageDataRelationships.JSON_PROPERTY_LINKS, + OnCallPageDataRelationships.JSON_PROPERTY_RESPONDERS, + OnCallPageDataRelationships.JSON_PROPERTY_SCHEDULED_ACTION, + OnCallPageDataRelationships.JSON_PROPERTY_SERVICE_NOW_INCIDENT, + OnCallPageDataRelationships.JSON_PROPERTY_TARGET, + OnCallPageDataRelationships.JSON_PROPERTY_TEAM_ROUTING_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR = "author"; + private OnCallPageAuthorRelationship author; + + public static final String JSON_PROPERTY_CLOSED_BY = "closed_by"; + private OnCallPageAuthorRelationship closedBy; + + public static final String JSON_PROPERTY_JIRA_ISSUE = "jira_issue"; + private OnCallPageJiraIssueRelationship jiraIssue; + + public static final String JSON_PROPERTY_LINKS = "links"; + private OnCallPageLinksRelationship links; + + public static final String JSON_PROPERTY_RESPONDERS = "responders"; + private OnCallPageRespondersRelationship responders; + + public static final String JSON_PROPERTY_SCHEDULED_ACTION = "scheduled_action"; + private OnCallPageScheduledActionRelationship scheduledAction; + + public static final String JSON_PROPERTY_SERVICE_NOW_INCIDENT = "service_now_incident"; + private OnCallPageServiceNowIncidentRelationship serviceNowIncident; + + public static final String JSON_PROPERTY_TARGET = "target"; + private OnCallPageTargetRelationship target; + + public static final String JSON_PROPERTY_TEAM_ROUTING_RULE = "team_routing_rule"; + private OnCallPageTeamRoutingRuleRelationship teamRoutingRule; + + public OnCallPageDataRelationships author(OnCallPageAuthorRelationship author) { + this.author = author; + this.unparsed |= author.unparsed; + return this; + } + + /** + * Reference to the entity that performed an action on the page. + * + * @return author + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageAuthorRelationship getAuthor() { + return author; + } + + public void setAuthor(OnCallPageAuthorRelationship author) { + this.author = author; + if (author != null) { + this.unparsed |= author.unparsed; + } + } + + public OnCallPageDataRelationships closedBy(OnCallPageAuthorRelationship closedBy) { + this.closedBy = closedBy; + this.unparsed |= closedBy.unparsed; + return this; + } + + /** + * Reference to the entity that performed an action on the page. + * + * @return closedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOSED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageAuthorRelationship getClosedBy() { + return closedBy; + } + + public void setClosedBy(OnCallPageAuthorRelationship closedBy) { + this.closedBy = closedBy; + if (closedBy != null) { + this.unparsed |= closedBy.unparsed; + } + } + + public OnCallPageDataRelationships jiraIssue(OnCallPageJiraIssueRelationship jiraIssue) { + this.jiraIssue = jiraIssue; + this.unparsed |= jiraIssue.unparsed; + return this; + } + + /** + * The Jira issue linked to the page. + * + * @return jiraIssue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JIRA_ISSUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageJiraIssueRelationship getJiraIssue() { + return jiraIssue; + } + + public void setJiraIssue(OnCallPageJiraIssueRelationship jiraIssue) { + this.jiraIssue = jiraIssue; + if (jiraIssue != null) { + this.unparsed |= jiraIssue.unparsed; + } + } + + public OnCallPageDataRelationships links(OnCallPageLinksRelationship links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Links between the page and other Datadog resources, such as incidents. Always empty when + * listing pages. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageLinksRelationship getLinks() { + return links; + } + + public void setLinks(OnCallPageLinksRelationship links) { + this.links = links; + if (links != null) { + this.unparsed |= links.unparsed; + } + } + + public OnCallPageDataRelationships responders(OnCallPageRespondersRelationship responders) { + this.responders = responders; + this.unparsed |= responders.unparsed; + return this; + } + + /** + * The users responding to the page. + * + * @return responders + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONDERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageRespondersRelationship getResponders() { + return responders; + } + + public void setResponders(OnCallPageRespondersRelationship responders) { + this.responders = responders; + if (responders != null) { + this.unparsed |= responders.unparsed; + } + } + + public OnCallPageDataRelationships scheduledAction( + OnCallPageScheduledActionRelationship scheduledAction) { + this.scheduledAction = scheduledAction; + this.unparsed |= scheduledAction.unparsed; + return this; + } + + /** + * The next action scheduled on the page, such as an escalation. + * + * @return scheduledAction + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULED_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageScheduledActionRelationship getScheduledAction() { + return scheduledAction; + } + + public void setScheduledAction(OnCallPageScheduledActionRelationship scheduledAction) { + this.scheduledAction = scheduledAction; + if (scheduledAction != null) { + this.unparsed |= scheduledAction.unparsed; + } + } + + public OnCallPageDataRelationships serviceNowIncident( + OnCallPageServiceNowIncidentRelationship serviceNowIncident) { + this.serviceNowIncident = serviceNowIncident; + this.unparsed |= serviceNowIncident.unparsed; + return this; + } + + /** + * The ServiceNow incident linked to the page. + * + * @return serviceNowIncident + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE_NOW_INCIDENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageServiceNowIncidentRelationship getServiceNowIncident() { + return serviceNowIncident; + } + + public void setServiceNowIncident(OnCallPageServiceNowIncidentRelationship serviceNowIncident) { + this.serviceNowIncident = serviceNowIncident; + if (serviceNowIncident != null) { + this.unparsed |= serviceNowIncident.unparsed; + } + } + + public OnCallPageDataRelationships target(OnCallPageTargetRelationship target) { + this.target = target; + this.unparsed |= target.unparsed; + return this; + } + + /** + * The team, user, or cross-organization handle that was paged. + * + * @return target + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageTargetRelationship getTarget() { + return target; + } + + public void setTarget(OnCallPageTargetRelationship target) { + this.target = target; + if (target != null) { + this.unparsed |= target.unparsed; + } + } + + public OnCallPageDataRelationships teamRoutingRule( + OnCallPageTeamRoutingRuleRelationship teamRoutingRule) { + this.teamRoutingRule = teamRoutingRule; + this.unparsed |= teamRoutingRule.unparsed; + return this; + } + + /** + * The team routing rule that matched the page. + * + * @return teamRoutingRule + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_ROUTING_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageTeamRoutingRuleRelationship getTeamRoutingRule() { + return teamRoutingRule; + } + + public void setTeamRoutingRule(OnCallPageTeamRoutingRuleRelationship teamRoutingRule) { + this.teamRoutingRule = teamRoutingRule; + if (teamRoutingRule != null) { + this.unparsed |= teamRoutingRule.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageDataRelationships + */ + @JsonAnySetter + public OnCallPageDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageDataRelationships onCallPageDataRelationships = (OnCallPageDataRelationships) o; + return Objects.equals(this.author, onCallPageDataRelationships.author) + && Objects.equals(this.closedBy, onCallPageDataRelationships.closedBy) + && Objects.equals(this.jiraIssue, onCallPageDataRelationships.jiraIssue) + && Objects.equals(this.links, onCallPageDataRelationships.links) + && Objects.equals(this.responders, onCallPageDataRelationships.responders) + && Objects.equals(this.scheduledAction, onCallPageDataRelationships.scheduledAction) + && Objects.equals(this.serviceNowIncident, onCallPageDataRelationships.serviceNowIncident) + && Objects.equals(this.target, onCallPageDataRelationships.target) + && Objects.equals(this.teamRoutingRule, onCallPageDataRelationships.teamRoutingRule) + && Objects.equals( + this.additionalProperties, onCallPageDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + author, + closedBy, + jiraIssue, + links, + responders, + scheduledAction, + serviceNowIncident, + target, + teamRoutingRule, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageDataRelationships {\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" closedBy: ").append(toIndentedString(closedBy)).append("\n"); + sb.append(" jiraIssue: ").append(toIndentedString(jiraIssue)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" responders: ").append(toIndentedString(responders)).append("\n"); + sb.append(" scheduledAction: ").append(toIndentedString(scheduledAction)).append("\n"); + sb.append(" serviceNowIncident: ").append(toIndentedString(serviceNowIncident)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).append("\n"); + sb.append(" teamRoutingRule: ").append(toIndentedString(teamRoutingRule)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataType.java new file mode 100644 index 00000000000..b53d5991a8f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageDataType.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Indicates that the resource is of type pages. */ +@JsonSerialize(using = OnCallPageDataType.OnCallPageDataTypeSerializer.class) +public class OnCallPageDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("pages")); + + public static final OnCallPageDataType PAGES = new OnCallPageDataType("pages"); + + OnCallPageDataType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageDataTypeSerializer extends StdSerializer { + public OnCallPageDataTypeSerializer(Class t) { + super(t); + } + + public OnCallPageDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(OnCallPageDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageDataType fromValue(String value) { + return new OnCallPageDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationship.java new file mode 100644 index 00000000000..f3a6851c393 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationship.java @@ -0,0 +1,141 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The Jira issue linked to the page. */ +@JsonPropertyOrder({OnCallPageJiraIssueRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageJiraIssueRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OnCallPageJiraIssueRelationshipData data; + + public OnCallPageJiraIssueRelationship data(OnCallPageJiraIssueRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Reference to a Jira issue. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageJiraIssueRelationshipData getData() { + return data; + } + + public void setData(OnCallPageJiraIssueRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageJiraIssueRelationship + */ + @JsonAnySetter + public OnCallPageJiraIssueRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageJiraIssueRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageJiraIssueRelationship onCallPageJiraIssueRelationship = + (OnCallPageJiraIssueRelationship) o; + return Objects.equals(this.data, onCallPageJiraIssueRelationship.data) + && Objects.equals( + this.additionalProperties, onCallPageJiraIssueRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageJiraIssueRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationshipData.java new file mode 100644 index 00000000000..1e0ee43f1fe --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueRelationshipData.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to a Jira issue. */ +@JsonPropertyOrder({ + OnCallPageJiraIssueRelationshipData.JSON_PROPERTY_ID, + OnCallPageJiraIssueRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageJiraIssueRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageJiraIssueType type = OnCallPageJiraIssueType.JIRA_ISSUES; + + public OnCallPageJiraIssueRelationshipData() {} + + @JsonCreator + public OnCallPageJiraIssueRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OnCallPageJiraIssueType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageJiraIssueRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the Jira issue, in the form <account_id>:<issue_id>. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageJiraIssueRelationshipData type(OnCallPageJiraIssueType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Jira issue resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageJiraIssueType getType() { + return type; + } + + public void setType(OnCallPageJiraIssueType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageJiraIssueRelationshipData + */ + @JsonAnySetter + public OnCallPageJiraIssueRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageJiraIssueRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageJiraIssueRelationshipData onCallPageJiraIssueRelationshipData = + (OnCallPageJiraIssueRelationshipData) o; + return Objects.equals(this.id, onCallPageJiraIssueRelationshipData.id) + && Objects.equals(this.type, onCallPageJiraIssueRelationshipData.type) + && Objects.equals( + this.additionalProperties, onCallPageJiraIssueRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageJiraIssueRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueType.java new file mode 100644 index 00000000000..1430e3a446f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageJiraIssueType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Jira issue resource type. */ +@JsonSerialize(using = OnCallPageJiraIssueType.OnCallPageJiraIssueTypeSerializer.class) +public class OnCallPageJiraIssueType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("jira_issues")); + + public static final OnCallPageJiraIssueType JIRA_ISSUES = + new OnCallPageJiraIssueType("jira_issues"); + + OnCallPageJiraIssueType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageJiraIssueTypeSerializer + extends StdSerializer { + public OnCallPageJiraIssueTypeSerializer(Class t) { + super(t); + } + + public OnCallPageJiraIssueTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageJiraIssueType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageJiraIssueType fromValue(String value) { + return new OnCallPageJiraIssueType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLink.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLink.java new file mode 100644 index 00000000000..19e186e753d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLink.java @@ -0,0 +1,211 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A link between a page and another Datadog resource, such as an incident. */ +@JsonPropertyOrder({ + OnCallPageLink.JSON_PROPERTY_ATTRIBUTES, + OnCallPageLink.JSON_PROPERTY_ID, + OnCallPageLink.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageLink { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OnCallPageLinkAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageLinkType type = OnCallPageLinkType.LINKS; + + public OnCallPageLink() {} + + @JsonCreator + public OnCallPageLink( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OnCallPageLinkType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageLink attributes(OnCallPageLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a page link. A page can be the child of another Datadog resource (for + * example, when an incident triggers it), or the parent of one (for example, when the page is + * escalated to an incident). + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OnCallPageLinkAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public OnCallPageLink id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the link. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageLink type(OnCallPageLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Page link resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageLinkType getType() { + return type; + } + + public void setType(OnCallPageLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageLink + */ + @JsonAnySetter + public OnCallPageLink putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageLink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageLink onCallPageLink = (OnCallPageLink) o; + return Objects.equals(this.attributes, onCallPageLink.attributes) + && Objects.equals(this.id, onCallPageLink.id) + && Objects.equals(this.type, onCallPageLink.type) + && Objects.equals(this.additionalProperties, onCallPageLink.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageLink {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkAttributes.java new file mode 100644 index 00000000000..9aa9d6c6e1b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkAttributes.java @@ -0,0 +1,285 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The attributes of a page link. A page can be the child of another Datadog resource (for example, + * when an incident triggers it), or the parent of one (for example, when the page is escalated to + * an incident). + */ +@JsonPropertyOrder({ + OnCallPageLinkAttributes.JSON_PROPERTY_CHILD_ENTITY_ID, + OnCallPageLinkAttributes.JSON_PROPERTY_CHILD_ENTITY_TYPE, + OnCallPageLinkAttributes.JSON_PROPERTY_PARENT_ENTITY_ID, + OnCallPageLinkAttributes.JSON_PROPERTY_PARENT_ENTITY_TYPE, + OnCallPageLinkAttributes.JSON_PROPERTY_RELATIONSHIP +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageLinkAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHILD_ENTITY_ID = "child_entity_id"; + private String childEntityId; + + public static final String JSON_PROPERTY_CHILD_ENTITY_TYPE = "child_entity_type"; + private OnCallPageLinkEntityType childEntityType; + + public static final String JSON_PROPERTY_PARENT_ENTITY_ID = "parent_entity_id"; + private String parentEntityId; + + public static final String JSON_PROPERTY_PARENT_ENTITY_TYPE = "parent_entity_type"; + private OnCallPageLinkEntityType parentEntityType; + + public static final String JSON_PROPERTY_RELATIONSHIP = "relationship"; + private OnCallPageLinkRelationshipType relationship; + + public OnCallPageLinkAttributes() {} + + @JsonCreator + public OnCallPageLinkAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CHILD_ENTITY_ID) String childEntityId, + @JsonProperty(required = true, value = JSON_PROPERTY_CHILD_ENTITY_TYPE) + OnCallPageLinkEntityType childEntityType, + @JsonProperty(required = true, value = JSON_PROPERTY_PARENT_ENTITY_ID) String parentEntityId, + @JsonProperty(required = true, value = JSON_PROPERTY_PARENT_ENTITY_TYPE) + OnCallPageLinkEntityType parentEntityType, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIP) + OnCallPageLinkRelationshipType relationship) { + this.childEntityId = childEntityId; + this.childEntityType = childEntityType; + this.unparsed |= !childEntityType.isValid(); + this.parentEntityId = parentEntityId; + this.parentEntityType = parentEntityType; + this.unparsed |= !parentEntityType.isValid(); + this.relationship = relationship; + this.unparsed |= !relationship.isValid(); + } + + public OnCallPageLinkAttributes childEntityId(String childEntityId) { + this.childEntityId = childEntityId; + return this; + } + + /** + * The ID of the child resource. + * + * @return childEntityId + */ + @JsonProperty(JSON_PROPERTY_CHILD_ENTITY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getChildEntityId() { + return childEntityId; + } + + public void setChildEntityId(String childEntityId) { + this.childEntityId = childEntityId; + } + + public OnCallPageLinkAttributes childEntityType(OnCallPageLinkEntityType childEntityType) { + this.childEntityType = childEntityType; + this.unparsed |= !childEntityType.isValid(); + return this; + } + + /** + * The type of a resource linked to a page. + * + * @return childEntityType + */ + @JsonProperty(JSON_PROPERTY_CHILD_ENTITY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageLinkEntityType getChildEntityType() { + return childEntityType; + } + + public void setChildEntityType(OnCallPageLinkEntityType childEntityType) { + if (!childEntityType.isValid()) { + this.unparsed = true; + } + this.childEntityType = childEntityType; + } + + public OnCallPageLinkAttributes parentEntityId(String parentEntityId) { + this.parentEntityId = parentEntityId; + return this; + } + + /** + * The ID of the parent resource. + * + * @return parentEntityId + */ + @JsonProperty(JSON_PROPERTY_PARENT_ENTITY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getParentEntityId() { + return parentEntityId; + } + + public void setParentEntityId(String parentEntityId) { + this.parentEntityId = parentEntityId; + } + + public OnCallPageLinkAttributes parentEntityType(OnCallPageLinkEntityType parentEntityType) { + this.parentEntityType = parentEntityType; + this.unparsed |= !parentEntityType.isValid(); + return this; + } + + /** + * The type of a resource linked to a page. + * + * @return parentEntityType + */ + @JsonProperty(JSON_PROPERTY_PARENT_ENTITY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageLinkEntityType getParentEntityType() { + return parentEntityType; + } + + public void setParentEntityType(OnCallPageLinkEntityType parentEntityType) { + if (!parentEntityType.isValid()) { + this.unparsed = true; + } + this.parentEntityType = parentEntityType; + } + + public OnCallPageLinkAttributes relationship(OnCallPageLinkRelationshipType relationship) { + this.relationship = relationship; + this.unparsed |= !relationship.isValid(); + return this; + } + + /** + * How the parent resource relates to the child resource. + * + * @return relationship + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageLinkRelationshipType getRelationship() { + return relationship; + } + + public void setRelationship(OnCallPageLinkRelationshipType relationship) { + if (!relationship.isValid()) { + this.unparsed = true; + } + this.relationship = relationship; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageLinkAttributes + */ + @JsonAnySetter + public OnCallPageLinkAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageLinkAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageLinkAttributes onCallPageLinkAttributes = (OnCallPageLinkAttributes) o; + return Objects.equals(this.childEntityId, onCallPageLinkAttributes.childEntityId) + && Objects.equals(this.childEntityType, onCallPageLinkAttributes.childEntityType) + && Objects.equals(this.parentEntityId, onCallPageLinkAttributes.parentEntityId) + && Objects.equals(this.parentEntityType, onCallPageLinkAttributes.parentEntityType) + && Objects.equals(this.relationship, onCallPageLinkAttributes.relationship) + && Objects.equals(this.additionalProperties, onCallPageLinkAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + childEntityId, + childEntityType, + parentEntityId, + parentEntityType, + relationship, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageLinkAttributes {\n"); + sb.append(" childEntityId: ").append(toIndentedString(childEntityId)).append("\n"); + sb.append(" childEntityType: ").append(toIndentedString(childEntityType)).append("\n"); + sb.append(" parentEntityId: ").append(toIndentedString(parentEntityId)).append("\n"); + sb.append(" parentEntityType: ").append(toIndentedString(parentEntityType)).append("\n"); + sb.append(" relationship: ").append(toIndentedString(relationship)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkEntityType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkEntityType.java new file mode 100644 index 00000000000..1bd09889651 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkEntityType.java @@ -0,0 +1,60 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of a resource linked to a page. */ +@JsonSerialize(using = OnCallPageLinkEntityType.OnCallPageLinkEntityTypeSerializer.class) +public class OnCallPageLinkEntityType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("case", "incident", "page", "agent_conversation")); + + public static final OnCallPageLinkEntityType CASE = new OnCallPageLinkEntityType("case"); + public static final OnCallPageLinkEntityType INCIDENT = new OnCallPageLinkEntityType("incident"); + public static final OnCallPageLinkEntityType PAGE = new OnCallPageLinkEntityType("page"); + public static final OnCallPageLinkEntityType AGENT_CONVERSATION = + new OnCallPageLinkEntityType("agent_conversation"); + + OnCallPageLinkEntityType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageLinkEntityTypeSerializer + extends StdSerializer { + public OnCallPageLinkEntityTypeSerializer(Class t) { + super(t); + } + + public OnCallPageLinkEntityTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageLinkEntityType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageLinkEntityType fromValue(String value) { + return new OnCallPageLinkEntityType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipData.java new file mode 100644 index 00000000000..1ff7c7e2466 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipData.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to a page link. */ +@JsonPropertyOrder({ + OnCallPageLinkRelationshipData.JSON_PROPERTY_ID, + OnCallPageLinkRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageLinkRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageLinkType type = OnCallPageLinkType.LINKS; + + public OnCallPageLinkRelationshipData() {} + + @JsonCreator + public OnCallPageLinkRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OnCallPageLinkType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageLinkRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the link. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageLinkRelationshipData type(OnCallPageLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Page link resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageLinkType getType() { + return type; + } + + public void setType(OnCallPageLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageLinkRelationshipData + */ + @JsonAnySetter + public OnCallPageLinkRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageLinkRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageLinkRelationshipData onCallPageLinkRelationshipData = + (OnCallPageLinkRelationshipData) o; + return Objects.equals(this.id, onCallPageLinkRelationshipData.id) + && Objects.equals(this.type, onCallPageLinkRelationshipData.type) + && Objects.equals( + this.additionalProperties, onCallPageLinkRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageLinkRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipType.java new file mode 100644 index 00000000000..40abecf7db2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkRelationshipType.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** How the parent resource relates to the child resource. */ +@JsonSerialize( + using = OnCallPageLinkRelationshipType.OnCallPageLinkRelationshipTypeSerializer.class) +public class OnCallPageLinkRelationshipType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "relates_to", + "causes", + "blocks", + "duplicates", + "parent_of", + "successor_of", + "escalates_to", + "pages")); + + public static final OnCallPageLinkRelationshipType RELATES_TO = + new OnCallPageLinkRelationshipType("relates_to"); + public static final OnCallPageLinkRelationshipType CAUSES = + new OnCallPageLinkRelationshipType("causes"); + public static final OnCallPageLinkRelationshipType BLOCKS = + new OnCallPageLinkRelationshipType("blocks"); + public static final OnCallPageLinkRelationshipType DUPLICATES = + new OnCallPageLinkRelationshipType("duplicates"); + public static final OnCallPageLinkRelationshipType PARENT_OF = + new OnCallPageLinkRelationshipType("parent_of"); + public static final OnCallPageLinkRelationshipType SUCCESSOR_OF = + new OnCallPageLinkRelationshipType("successor_of"); + public static final OnCallPageLinkRelationshipType ESCALATES_TO = + new OnCallPageLinkRelationshipType("escalates_to"); + public static final OnCallPageLinkRelationshipType PAGES = + new OnCallPageLinkRelationshipType("pages"); + + OnCallPageLinkRelationshipType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageLinkRelationshipTypeSerializer + extends StdSerializer { + public OnCallPageLinkRelationshipTypeSerializer(Class t) { + super(t); + } + + public OnCallPageLinkRelationshipTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageLinkRelationshipType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageLinkRelationshipType fromValue(String value) { + return new OnCallPageLinkRelationshipType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkType.java new file mode 100644 index 00000000000..f0644592405 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinkType.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Page link resource type. */ +@JsonSerialize(using = OnCallPageLinkType.OnCallPageLinkTypeSerializer.class) +public class OnCallPageLinkType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("links")); + + public static final OnCallPageLinkType LINKS = new OnCallPageLinkType("links"); + + OnCallPageLinkType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageLinkTypeSerializer extends StdSerializer { + public OnCallPageLinkTypeSerializer(Class t) { + super(t); + } + + public OnCallPageLinkTypeSerializer() { + this(null); + } + + @Override + public void serialize(OnCallPageLinkType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageLinkType fromValue(String value) { + return new OnCallPageLinkType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinksRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinksRelationship.java new file mode 100644 index 00000000000..7accfb5de28 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLinksRelationship.java @@ -0,0 +1,160 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Links between the page and other Datadog resources, such as incidents. Always empty when listing + * pages. + */ +@JsonPropertyOrder({OnCallPageLinksRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageLinksRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public OnCallPageLinksRelationship data(List data) { + this.data = data; + if (data != null) { + for (OnCallPageLinkRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public OnCallPageLinksRelationship addDataItem(OnCallPageLinkRelationshipData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of page links. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (OnCallPageLinkRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageLinksRelationship + */ + @JsonAnySetter + public OnCallPageLinksRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageLinksRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageLinksRelationship onCallPageLinksRelationship = (OnCallPageLinksRelationship) o; + return Objects.equals(this.data, onCallPageLinksRelationship.data) + && Objects.equals( + this.additionalProperties, onCallPageLinksRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageLinksRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCall.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCall.java new file mode 100644 index 00000000000..97e32835933 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCall.java @@ -0,0 +1,139 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Live call information for a page triggered by a live call route. */ +@JsonPropertyOrder({OnCallPageLiveCall.JSON_PROPERTY_CALL_OVER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageLiveCall { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CALL_OVER = "call_over"; + private OnCallPageLiveCallOver callOver; + + public OnCallPageLiveCall callOver(OnCallPageLiveCallOver callOver) { + this.callOver = callOver; + this.unparsed |= callOver.unparsed; + return this; + } + + /** + * Information about a live call that has ended. + * + * @return callOver + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CALL_OVER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageLiveCallOver getCallOver() { + return callOver; + } + + public void setCallOver(OnCallPageLiveCallOver callOver) { + this.callOver = callOver; + if (callOver != null) { + this.unparsed |= callOver.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageLiveCall + */ + @JsonAnySetter + public OnCallPageLiveCall putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageLiveCall object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageLiveCall onCallPageLiveCall = (OnCallPageLiveCall) o; + return Objects.equals(this.callOver, onCallPageLiveCall.callOver) + && Objects.equals(this.additionalProperties, onCallPageLiveCall.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(callOver, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageLiveCall {\n"); + sb.append(" callOver: ").append(toIndentedString(callOver)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOutcome.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOutcome.java new file mode 100644 index 00000000000..ed5f647fe41 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOutcome.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The outcome of a live call that has ended. */ +@JsonSerialize(using = OnCallPageLiveCallOutcome.OnCallPageLiveCallOutcomeSerializer.class) +public class OnCallPageLiveCallOutcome extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "success_call_answered", + "failure_no_responder", + "failure_caller_abandoned", + "failure_outside_support_hours", + "failure_internal_error")); + + public static final OnCallPageLiveCallOutcome SUCCESS_CALL_ANSWERED = + new OnCallPageLiveCallOutcome("success_call_answered"); + public static final OnCallPageLiveCallOutcome FAILURE_NO_RESPONDER = + new OnCallPageLiveCallOutcome("failure_no_responder"); + public static final OnCallPageLiveCallOutcome FAILURE_CALLER_ABANDONED = + new OnCallPageLiveCallOutcome("failure_caller_abandoned"); + public static final OnCallPageLiveCallOutcome FAILURE_OUTSIDE_SUPPORT_HOURS = + new OnCallPageLiveCallOutcome("failure_outside_support_hours"); + public static final OnCallPageLiveCallOutcome FAILURE_INTERNAL_ERROR = + new OnCallPageLiveCallOutcome("failure_internal_error"); + + OnCallPageLiveCallOutcome(String value) { + super(value, allowedValues); + } + + public static class OnCallPageLiveCallOutcomeSerializer + extends StdSerializer { + public OnCallPageLiveCallOutcomeSerializer(Class t) { + super(t); + } + + public OnCallPageLiveCallOutcomeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageLiveCallOutcome value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageLiveCallOutcome fromValue(String value) { + return new OnCallPageLiveCallOutcome(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOver.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOver.java new file mode 100644 index 00000000000..9cbe82ab286 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageLiveCallOver.java @@ -0,0 +1,171 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Information about a live call that has ended. */ +@JsonPropertyOrder({ + OnCallPageLiveCallOver.JSON_PROPERTY_OUTCOME, + OnCallPageLiveCallOver.JSON_PROPERTY_SUPPORT_HOURS_START_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageLiveCallOver { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OUTCOME = "outcome"; + private OnCallPageLiveCallOutcome outcome; + + public static final String JSON_PROPERTY_SUPPORT_HOURS_START_AT = "support_hours_start_at"; + private OffsetDateTime supportHoursStartAt; + + public OnCallPageLiveCallOver outcome(OnCallPageLiveCallOutcome outcome) { + this.outcome = outcome; + this.unparsed |= !outcome.isValid(); + return this; + } + + /** + * The outcome of a live call that has ended. + * + * @return outcome + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTCOME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageLiveCallOutcome getOutcome() { + return outcome; + } + + public void setOutcome(OnCallPageLiveCallOutcome outcome) { + if (!outcome.isValid()) { + this.unparsed = true; + } + this.outcome = outcome; + } + + public OnCallPageLiveCallOver supportHoursStartAt(OffsetDateTime supportHoursStartAt) { + this.supportHoursStartAt = supportHoursStartAt; + return this; + } + + /** + * When support hours start, if the call was placed outside support hours. + * + * @return supportHoursStartAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUPPORT_HOURS_START_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getSupportHoursStartAt() { + return supportHoursStartAt; + } + + public void setSupportHoursStartAt(OffsetDateTime supportHoursStartAt) { + this.supportHoursStartAt = supportHoursStartAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageLiveCallOver + */ + @JsonAnySetter + public OnCallPageLiveCallOver putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageLiveCallOver object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageLiveCallOver onCallPageLiveCallOver = (OnCallPageLiveCallOver) o; + return Objects.equals(this.outcome, onCallPageLiveCallOver.outcome) + && Objects.equals(this.supportHoursStartAt, onCallPageLiveCallOver.supportHoursStartAt) + && Objects.equals(this.additionalProperties, onCallPageLiveCallOver.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(outcome, supportHoursStartAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageLiveCallOver {\n"); + sb.append(" outcome: ").append(toIndentedString(outcome)).append("\n"); + sb.append(" supportHoursStartAt: ") + .append(toIndentedString(supportHoursStartAt)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageReleaseOrigin.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageReleaseOrigin.java new file mode 100644 index 00000000000..1e6acab97d3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageReleaseOrigin.java @@ -0,0 +1,66 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * What snoozed the page. Only set while the page is snoozed, together with release_at. + * ack_timeout: the acknowledgment timeout. team_rules_active_hours: the + * page was triggered outside of the active hours of the team's routing rules. manual_snooze + * : a user snoozed the page. + */ +@JsonSerialize(using = OnCallPageReleaseOrigin.OnCallPageReleaseOriginSerializer.class) +public class OnCallPageReleaseOrigin extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("ack_timeout", "team_rules_active_hours", "manual_snooze")); + + public static final OnCallPageReleaseOrigin ACK_TIMEOUT = + new OnCallPageReleaseOrigin("ack_timeout"); + public static final OnCallPageReleaseOrigin TEAM_RULES_ACTIVE_HOURS = + new OnCallPageReleaseOrigin("team_rules_active_hours"); + public static final OnCallPageReleaseOrigin MANUAL_SNOOZE = + new OnCallPageReleaseOrigin("manual_snooze"); + + OnCallPageReleaseOrigin(String value) { + super(value, allowedValues); + } + + public static class OnCallPageReleaseOriginSerializer + extends StdSerializer { + public OnCallPageReleaseOriginSerializer(Class t) { + super(t); + } + + public OnCallPageReleaseOriginSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageReleaseOrigin value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageReleaseOrigin fromValue(String value) { + return new OnCallPageReleaseOrigin(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageRespondersRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageRespondersRelationship.java new file mode 100644 index 00000000000..89152217b48 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageRespondersRelationship.java @@ -0,0 +1,158 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The users responding to the page. */ +@JsonPropertyOrder({OnCallPageRespondersRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageRespondersRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public OnCallPageRespondersRelationship data(List data) { + this.data = data; + if (data != null) { + for (OnCallPageUserRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public OnCallPageRespondersRelationship addDataItem(OnCallPageUserRelationshipData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of responders. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (OnCallPageUserRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageRespondersRelationship + */ + @JsonAnySetter + public OnCallPageRespondersRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageRespondersRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageRespondersRelationship onCallPageRespondersRelationship = + (OnCallPageRespondersRelationship) o; + return Objects.equals(this.data, onCallPageRespondersRelationship.data) + && Objects.equals( + this.additionalProperties, onCallPageRespondersRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageRespondersRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageResponse.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageResponse.java new file mode 100644 index 00000000000..4eee227df56 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageResponse.java @@ -0,0 +1,198 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A single On-Call Page with its related included resources. */ +@JsonPropertyOrder({ + OnCallPageResponse.JSON_PROPERTY_DATA, + OnCallPageResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OnCallPageData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public OnCallPageResponse() {} + + @JsonCreator + public OnCallPageResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) OnCallPageData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public OnCallPageResponse data(OnCallPageData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * An On-Call Page. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageData getData() { + return data; + } + + public void setData(OnCallPageData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public OnCallPageResponse included(List included) { + this.included = included; + if (included != null) { + for (OnCallPagesIncluded item : included) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public OnCallPageResponse addIncludedItem(OnCallPagesIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Resources related to the page, such as users, teams, scheduled actions, and links. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + if (included != null) { + for (OnCallPagesIncluded item : included) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageResponse + */ + @JsonAnySetter + public OnCallPageResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageResponse onCallPageResponse = (OnCallPageResponse) o; + return Objects.equals(this.data, onCallPageResponse.data) + && Objects.equals(this.included, onCallPageResponse.included) + && Objects.equals(this.additionalProperties, onCallPageResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledAction.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledAction.java new file mode 100644 index 00000000000..7efaae0e692 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledAction.java @@ -0,0 +1,243 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The next action scheduled on a page, such as an escalation or an automatic resolution. */ +@JsonPropertyOrder({ + OnCallPageScheduledAction.JSON_PROPERTY_ATTRIBUTES, + OnCallPageScheduledAction.JSON_PROPERTY_ID, + OnCallPageScheduledAction.JSON_PROPERTY_RELATIONSHIPS, + OnCallPageScheduledAction.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledAction { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OnCallPageScheduledActionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private OnCallPageScheduledActionRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageScheduledActionType type = OnCallPageScheduledActionType.SCHEDULED_ACTIONS; + + public OnCallPageScheduledAction() {} + + @JsonCreator + public OnCallPageScheduledAction( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + OnCallPageScheduledActionType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageScheduledAction attributes(OnCallPageScheduledActionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a scheduled action. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageScheduledActionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OnCallPageScheduledActionAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public OnCallPageScheduledAction id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the scheduled action. Equal to the page ID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageScheduledAction relationships( + OnCallPageScheduledActionRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * The relationships of a scheduled action. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageScheduledActionRelationships getRelationships() { + return relationships; + } + + public void setRelationships(OnCallPageScheduledActionRelationships relationships) { + this.relationships = relationships; + if (relationships != null) { + this.unparsed |= relationships.unparsed; + } + } + + public OnCallPageScheduledAction type(OnCallPageScheduledActionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Scheduled action resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageScheduledActionType getType() { + return type; + } + + public void setType(OnCallPageScheduledActionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledAction + */ + @JsonAnySetter + public OnCallPageScheduledAction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageScheduledAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledAction onCallPageScheduledAction = (OnCallPageScheduledAction) o; + return Objects.equals(this.attributes, onCallPageScheduledAction.attributes) + && Objects.equals(this.id, onCallPageScheduledAction.id) + && Objects.equals(this.relationships, onCallPageScheduledAction.relationships) + && Objects.equals(this.type, onCallPageScheduledAction.type) + && Objects.equals( + this.additionalProperties, onCallPageScheduledAction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledAction {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributes.java new file mode 100644 index 00000000000..ae84b15481c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributes.java @@ -0,0 +1,171 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a scheduled action. */ +@JsonPropertyOrder({ + OnCallPageScheduledActionAttributes.JSON_PROPERTY_AT, + OnCallPageScheduledActionAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledActionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AT = "at"; + private OffsetDateTime at; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageScheduledActionAttributesType type; + + public OnCallPageScheduledActionAttributes at(OffsetDateTime at) { + this.at = at; + return this; + } + + /** + * The time when the action is scheduled to run. + * + * @return at + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getAt() { + return at; + } + + public void setAt(OffsetDateTime at) { + this.at = at; + } + + public OnCallPageScheduledActionAttributes type(OnCallPageScheduledActionAttributesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The kind of action that is scheduled. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageScheduledActionAttributesType getType() { + return type; + } + + public void setType(OnCallPageScheduledActionAttributesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledActionAttributes + */ + @JsonAnySetter + public OnCallPageScheduledActionAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageScheduledActionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledActionAttributes onCallPageScheduledActionAttributes = + (OnCallPageScheduledActionAttributes) o; + return Objects.equals(this.at, onCallPageScheduledActionAttributes.at) + && Objects.equals(this.type, onCallPageScheduledActionAttributes.type) + && Objects.equals( + this.additionalProperties, onCallPageScheduledActionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(at, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledActionAttributes {\n"); + sb.append(" at: ").append(toIndentedString(at)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributesType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributesType.java new file mode 100644 index 00000000000..3711a35774e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionAttributesType.java @@ -0,0 +1,69 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The kind of action that is scheduled. */ +@JsonSerialize( + using = + OnCallPageScheduledActionAttributesType.OnCallPageScheduledActionAttributesTypeSerializer + .class) +public class OnCallPageScheduledActionAttributesType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("escalate", "resolve", "release", "retrigger")); + + public static final OnCallPageScheduledActionAttributesType ESCALATE = + new OnCallPageScheduledActionAttributesType("escalate"); + public static final OnCallPageScheduledActionAttributesType RESOLVE = + new OnCallPageScheduledActionAttributesType("resolve"); + public static final OnCallPageScheduledActionAttributesType RELEASE = + new OnCallPageScheduledActionAttributesType("release"); + public static final OnCallPageScheduledActionAttributesType RETRIGGER = + new OnCallPageScheduledActionAttributesType("retrigger"); + + OnCallPageScheduledActionAttributesType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageScheduledActionAttributesTypeSerializer + extends StdSerializer { + public OnCallPageScheduledActionAttributesTypeSerializer( + Class t) { + super(t); + } + + public OnCallPageScheduledActionAttributesTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageScheduledActionAttributesType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageScheduledActionAttributesType fromValue(String value) { + return new OnCallPageScheduledActionAttributesType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationship.java new file mode 100644 index 00000000000..b0b0a296853 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationship.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The next action scheduled on the page, such as an escalation. */ +@JsonPropertyOrder({OnCallPageScheduledActionRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledActionRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private JsonNullable data = + JsonNullable.undefined(); + + public OnCallPageScheduledActionRelationship data( + OnCallPageScheduledActionRelationshipData data) { + this.data = JsonNullable.of(data); + return this; + } + + /** + * Reference to the next scheduled action on the page. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OnCallPageScheduledActionRelationshipData getData() { + return data.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable data) { + this.data = data; + } + + public void setData(OnCallPageScheduledActionRelationshipData data) { + this.data = JsonNullable.of(data); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledActionRelationship + */ + @JsonAnySetter + public OnCallPageScheduledActionRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageScheduledActionRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledActionRelationship onCallPageScheduledActionRelationship = + (OnCallPageScheduledActionRelationship) o; + return Objects.equals(this.data, onCallPageScheduledActionRelationship.data) + && Objects.equals( + this.additionalProperties, onCallPageScheduledActionRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledActionRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipData.java new file mode 100644 index 00000000000..1e169067746 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipData.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to the next scheduled action on the page. */ +@JsonPropertyOrder({ + OnCallPageScheduledActionRelationshipData.JSON_PROPERTY_ID, + OnCallPageScheduledActionRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledActionRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageScheduledActionType type = OnCallPageScheduledActionType.SCHEDULED_ACTIONS; + + public OnCallPageScheduledActionRelationshipData() {} + + @JsonCreator + public OnCallPageScheduledActionRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + OnCallPageScheduledActionType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageScheduledActionRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the scheduled action. Equal to the page ID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageScheduledActionRelationshipData type(OnCallPageScheduledActionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Scheduled action resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageScheduledActionType getType() { + return type; + } + + public void setType(OnCallPageScheduledActionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledActionRelationshipData + */ + @JsonAnySetter + public OnCallPageScheduledActionRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageScheduledActionRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledActionRelationshipData onCallPageScheduledActionRelationshipData = + (OnCallPageScheduledActionRelationshipData) o; + return Objects.equals(this.id, onCallPageScheduledActionRelationshipData.id) + && Objects.equals(this.type, onCallPageScheduledActionRelationshipData.type) + && Objects.equals( + this.additionalProperties, + onCallPageScheduledActionRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledActionRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationships.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationships.java new file mode 100644 index 00000000000..77989b699a9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationships.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The relationships of a scheduled action. */ +@JsonPropertyOrder({ + OnCallPageScheduledActionRelationships.JSON_PROPERTY_SCHEDULES, + OnCallPageScheduledActionRelationships.JSON_PROPERTY_USERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledActionRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SCHEDULES = "schedules"; + private OnCallPageScheduledActionRelationshipsSchedules schedules; + + public static final String JSON_PROPERTY_USERS = "users"; + private OnCallPageScheduledActionRelationshipsUsers users; + + public OnCallPageScheduledActionRelationships schedules( + OnCallPageScheduledActionRelationshipsSchedules schedules) { + this.schedules = schedules; + this.unparsed |= schedules.unparsed; + return this; + } + + /** + * The schedules the action escalates to. + * + * @return schedules + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageScheduledActionRelationshipsSchedules getSchedules() { + return schedules; + } + + public void setSchedules(OnCallPageScheduledActionRelationshipsSchedules schedules) { + this.schedules = schedules; + if (schedules != null) { + this.unparsed |= schedules.unparsed; + } + } + + public OnCallPageScheduledActionRelationships users( + OnCallPageScheduledActionRelationshipsUsers users) { + this.users = users; + this.unparsed |= users.unparsed; + return this; + } + + /** + * The users the action escalates to. + * + * @return users + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageScheduledActionRelationshipsUsers getUsers() { + return users; + } + + public void setUsers(OnCallPageScheduledActionRelationshipsUsers users) { + this.users = users; + if (users != null) { + this.unparsed |= users.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledActionRelationships + */ + @JsonAnySetter + public OnCallPageScheduledActionRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageScheduledActionRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledActionRelationships onCallPageScheduledActionRelationships = + (OnCallPageScheduledActionRelationships) o; + return Objects.equals(this.schedules, onCallPageScheduledActionRelationships.schedules) + && Objects.equals(this.users, onCallPageScheduledActionRelationships.users) + && Objects.equals( + this.additionalProperties, onCallPageScheduledActionRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(schedules, users, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledActionRelationships {\n"); + sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedules.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedules.java new file mode 100644 index 00000000000..d6b027ed3ee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedules.java @@ -0,0 +1,163 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The schedules the action escalates to. */ +@JsonPropertyOrder({OnCallPageScheduledActionRelationshipsSchedules.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledActionRelationshipsSchedules { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public OnCallPageScheduledActionRelationshipsSchedules data( + List data) { + this.data = data; + if (data != null) { + for (OnCallPageScheduledActionRelationshipsSchedulesData item : data) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public OnCallPageScheduledActionRelationshipsSchedules addDataItem( + OnCallPageScheduledActionRelationshipsSchedulesData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of schedules. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (OnCallPageScheduledActionRelationshipsSchedulesData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledActionRelationshipsSchedules + */ + @JsonAnySetter + public OnCallPageScheduledActionRelationshipsSchedules putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageScheduledActionRelationshipsSchedules object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledActionRelationshipsSchedules + onCallPageScheduledActionRelationshipsSchedules = + (OnCallPageScheduledActionRelationshipsSchedules) o; + return Objects.equals(this.data, onCallPageScheduledActionRelationshipsSchedules.data) + && Objects.equals( + this.additionalProperties, + onCallPageScheduledActionRelationshipsSchedules.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledActionRelationshipsSchedules {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedulesData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedulesData.java new file mode 100644 index 00000000000..f1c3db0c39c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsSchedulesData.java @@ -0,0 +1,185 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to a schedule. */ +@JsonPropertyOrder({ + OnCallPageScheduledActionRelationshipsSchedulesData.JSON_PROPERTY_ID, + OnCallPageScheduledActionRelationshipsSchedulesData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledActionRelationshipsSchedulesData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ScheduleDataType type = ScheduleDataType.SCHEDULES; + + public OnCallPageScheduledActionRelationshipsSchedulesData() {} + + @JsonCreator + public OnCallPageScheduledActionRelationshipsSchedulesData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ScheduleDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageScheduledActionRelationshipsSchedulesData id(String id) { + this.id = id; + return this; + } + + /** + * The schedule ID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageScheduledActionRelationshipsSchedulesData type(ScheduleDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Schedules resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScheduleDataType getType() { + return type; + } + + public void setType(ScheduleDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledActionRelationshipsSchedulesData + */ + @JsonAnySetter + public OnCallPageScheduledActionRelationshipsSchedulesData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this OnCallPageScheduledActionRelationshipsSchedulesData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledActionRelationshipsSchedulesData + onCallPageScheduledActionRelationshipsSchedulesData = + (OnCallPageScheduledActionRelationshipsSchedulesData) o; + return Objects.equals(this.id, onCallPageScheduledActionRelationshipsSchedulesData.id) + && Objects.equals(this.type, onCallPageScheduledActionRelationshipsSchedulesData.type) + && Objects.equals( + this.additionalProperties, + onCallPageScheduledActionRelationshipsSchedulesData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledActionRelationshipsSchedulesData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsUsers.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsUsers.java new file mode 100644 index 00000000000..68002a0dd12 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionRelationshipsUsers.java @@ -0,0 +1,162 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The users the action escalates to. */ +@JsonPropertyOrder({OnCallPageScheduledActionRelationshipsUsers.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageScheduledActionRelationshipsUsers { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public OnCallPageScheduledActionRelationshipsUsers data( + List data) { + this.data = data; + if (data != null) { + for (OnCallPageUserRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public OnCallPageScheduledActionRelationshipsUsers addDataItem( + OnCallPageUserRelationshipData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of users. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (OnCallPageUserRelationshipData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageScheduledActionRelationshipsUsers + */ + @JsonAnySetter + public OnCallPageScheduledActionRelationshipsUsers putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageScheduledActionRelationshipsUsers object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageScheduledActionRelationshipsUsers onCallPageScheduledActionRelationshipsUsers = + (OnCallPageScheduledActionRelationshipsUsers) o; + return Objects.equals(this.data, onCallPageScheduledActionRelationshipsUsers.data) + && Objects.equals( + this.additionalProperties, + onCallPageScheduledActionRelationshipsUsers.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageScheduledActionRelationshipsUsers {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionType.java new file mode 100644 index 00000000000..86ba864e044 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageScheduledActionType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Scheduled action resource type. */ +@JsonSerialize(using = OnCallPageScheduledActionType.OnCallPageScheduledActionTypeSerializer.class) +public class OnCallPageScheduledActionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("scheduled_actions")); + + public static final OnCallPageScheduledActionType SCHEDULED_ACTIONS = + new OnCallPageScheduledActionType("scheduled_actions"); + + OnCallPageScheduledActionType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageScheduledActionTypeSerializer + extends StdSerializer { + public OnCallPageScheduledActionTypeSerializer(Class t) { + super(t); + } + + public OnCallPageScheduledActionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageScheduledActionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageScheduledActionType fromValue(String value) { + return new OnCallPageScheduledActionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationship.java new file mode 100644 index 00000000000..448f55e9624 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationship.java @@ -0,0 +1,143 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The ServiceNow incident linked to the page. */ +@JsonPropertyOrder({OnCallPageServiceNowIncidentRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageServiceNowIncidentRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OnCallPageServiceNowIncidentRelationshipData data; + + public OnCallPageServiceNowIncidentRelationship data( + OnCallPageServiceNowIncidentRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Reference to a ServiceNow incident. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageServiceNowIncidentRelationshipData getData() { + return data; + } + + public void setData(OnCallPageServiceNowIncidentRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageServiceNowIncidentRelationship + */ + @JsonAnySetter + public OnCallPageServiceNowIncidentRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageServiceNowIncidentRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageServiceNowIncidentRelationship onCallPageServiceNowIncidentRelationship = + (OnCallPageServiceNowIncidentRelationship) o; + return Objects.equals(this.data, onCallPageServiceNowIncidentRelationship.data) + && Objects.equals( + this.additionalProperties, + onCallPageServiceNowIncidentRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageServiceNowIncidentRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationshipData.java new file mode 100644 index 00000000000..9df4de43687 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentRelationshipData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to a ServiceNow incident. */ +@JsonPropertyOrder({ + OnCallPageServiceNowIncidentRelationshipData.JSON_PROPERTY_ID, + OnCallPageServiceNowIncidentRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageServiceNowIncidentRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageServiceNowIncidentType type = + OnCallPageServiceNowIncidentType.SERVICE_NOW_INCIDENTS; + + public OnCallPageServiceNowIncidentRelationshipData() {} + + @JsonCreator + public OnCallPageServiceNowIncidentRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + OnCallPageServiceNowIncidentType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageServiceNowIncidentRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the ServiceNow incident. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageServiceNowIncidentRelationshipData type(OnCallPageServiceNowIncidentType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * ServiceNow incident resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageServiceNowIncidentType getType() { + return type; + } + + public void setType(OnCallPageServiceNowIncidentType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageServiceNowIncidentRelationshipData + */ + @JsonAnySetter + public OnCallPageServiceNowIncidentRelationshipData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageServiceNowIncidentRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageServiceNowIncidentRelationshipData onCallPageServiceNowIncidentRelationshipData = + (OnCallPageServiceNowIncidentRelationshipData) o; + return Objects.equals(this.id, onCallPageServiceNowIncidentRelationshipData.id) + && Objects.equals(this.type, onCallPageServiceNowIncidentRelationshipData.type) + && Objects.equals( + this.additionalProperties, + onCallPageServiceNowIncidentRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageServiceNowIncidentRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentType.java new file mode 100644 index 00000000000..20cde27aafd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageServiceNowIncidentType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** ServiceNow incident resource type. */ +@JsonSerialize( + using = OnCallPageServiceNowIncidentType.OnCallPageServiceNowIncidentTypeSerializer.class) +public class OnCallPageServiceNowIncidentType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("service_now_incidents")); + + public static final OnCallPageServiceNowIncidentType SERVICE_NOW_INCIDENTS = + new OnCallPageServiceNowIncidentType("service_now_incidents"); + + OnCallPageServiceNowIncidentType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageServiceNowIncidentTypeSerializer + extends StdSerializer { + public OnCallPageServiceNowIncidentTypeSerializer(Class t) { + super(t); + } + + public OnCallPageServiceNowIncidentTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageServiceNowIncidentType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageServiceNowIncidentType fromValue(String value) { + return new OnCallPageServiceNowIncidentType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageStatus.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageStatus.java new file mode 100644 index 00000000000..e7bb68b19e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageStatus.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The current status of the On-Call Page. */ +@JsonSerialize(using = OnCallPageStatus.OnCallPageStatusSerializer.class) +public class OnCallPageStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("triggered", "acknowledged", "resolved")); + + public static final OnCallPageStatus TRIGGERED = new OnCallPageStatus("triggered"); + public static final OnCallPageStatus ACKNOWLEDGED = new OnCallPageStatus("acknowledged"); + public static final OnCallPageStatus RESOLVED = new OnCallPageStatus("resolved"); + + OnCallPageStatus(String value) { + super(value, allowedValues); + } + + public static class OnCallPageStatusSerializer extends StdSerializer { + public OnCallPageStatusSerializer(Class t) { + super(t); + } + + public OnCallPageStatusSerializer() { + this(null); + } + + @Override + public void serialize(OnCallPageStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageStatus fromValue(String value) { + return new OnCallPageStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationship.java new file mode 100644 index 00000000000..2d0aeec95de --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationship.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The team, user, or cross-organization handle that was paged. */ +@JsonPropertyOrder({OnCallPageTargetRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageTargetRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private JsonNullable data = + JsonNullable.undefined(); + + public OnCallPageTargetRelationship data(OnCallPageTargetRelationshipData data) { + this.data = JsonNullable.of(data); + return this; + } + + /** + * Reference to the target of the page. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OnCallPageTargetRelationshipData getData() { + return data.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable data) { + this.data = data; + } + + public void setData(OnCallPageTargetRelationshipData data) { + this.data = JsonNullable.of(data); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageTargetRelationship + */ + @JsonAnySetter + public OnCallPageTargetRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageTargetRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageTargetRelationship onCallPageTargetRelationship = (OnCallPageTargetRelationship) o; + return Objects.equals(this.data, onCallPageTargetRelationship.data) + && Objects.equals( + this.additionalProperties, onCallPageTargetRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageTargetRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipData.java new file mode 100644 index 00000000000..8cfba99ee78 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to the target of the page. */ +@JsonPropertyOrder({ + OnCallPageTargetRelationshipData.JSON_PROPERTY_ID, + OnCallPageTargetRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageTargetRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OnCallPageTargetRelationshipDataType type; + + public OnCallPageTargetRelationshipData() {} + + @JsonCreator + public OnCallPageTargetRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + OnCallPageTargetRelationshipDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageTargetRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the target. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageTargetRelationshipData type(OnCallPageTargetRelationshipDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type of the page target. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OnCallPageTargetRelationshipDataType getType() { + return type; + } + + public void setType(OnCallPageTargetRelationshipDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageTargetRelationshipData + */ + @JsonAnySetter + public OnCallPageTargetRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageTargetRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageTargetRelationshipData onCallPageTargetRelationshipData = + (OnCallPageTargetRelationshipData) o; + return Objects.equals(this.id, onCallPageTargetRelationshipData.id) + && Objects.equals(this.type, onCallPageTargetRelationshipData.type) + && Objects.equals( + this.additionalProperties, onCallPageTargetRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageTargetRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipDataType.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipDataType.java new file mode 100644 index 00000000000..c476b52e501 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTargetRelationshipDataType.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type of the page target. */ +@JsonSerialize( + using = + OnCallPageTargetRelationshipDataType.OnCallPageTargetRelationshipDataTypeSerializer.class) +public class OnCallPageTargetRelationshipDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("teams", "users", "cross_org_handles")); + + public static final OnCallPageTargetRelationshipDataType TEAMS = + new OnCallPageTargetRelationshipDataType("teams"); + public static final OnCallPageTargetRelationshipDataType USERS = + new OnCallPageTargetRelationshipDataType("users"); + public static final OnCallPageTargetRelationshipDataType CROSS_ORG_HANDLES = + new OnCallPageTargetRelationshipDataType("cross_org_handles"); + + OnCallPageTargetRelationshipDataType(String value) { + super(value, allowedValues); + } + + public static class OnCallPageTargetRelationshipDataTypeSerializer + extends StdSerializer { + public OnCallPageTargetRelationshipDataTypeSerializer( + Class t) { + super(t); + } + + public OnCallPageTargetRelationshipDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPageTargetRelationshipDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPageTargetRelationshipDataType fromValue(String value) { + return new OnCallPageTargetRelationshipDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationship.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationship.java new file mode 100644 index 00000000000..7c01ba34d9e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationship.java @@ -0,0 +1,142 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The team routing rule that matched the page. */ +@JsonPropertyOrder({OnCallPageTeamRoutingRuleRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageTeamRoutingRuleRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private OnCallPageTeamRoutingRuleRelationshipData data; + + public OnCallPageTeamRoutingRuleRelationship data( + OnCallPageTeamRoutingRuleRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Reference to a team routing rule. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OnCallPageTeamRoutingRuleRelationshipData getData() { + return data; + } + + public void setData(OnCallPageTeamRoutingRuleRelationshipData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageTeamRoutingRuleRelationship + */ + @JsonAnySetter + public OnCallPageTeamRoutingRuleRelationship putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageTeamRoutingRuleRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageTeamRoutingRuleRelationship onCallPageTeamRoutingRuleRelationship = + (OnCallPageTeamRoutingRuleRelationship) o; + return Objects.equals(this.data, onCallPageTeamRoutingRuleRelationship.data) + && Objects.equals( + this.additionalProperties, onCallPageTeamRoutingRuleRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageTeamRoutingRuleRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationshipData.java new file mode 100644 index 00000000000..438941aae2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageTeamRoutingRuleRelationshipData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to a team routing rule. */ +@JsonPropertyOrder({ + OnCallPageTeamRoutingRuleRelationshipData.JSON_PROPERTY_ID, + OnCallPageTeamRoutingRuleRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageTeamRoutingRuleRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamRoutingRulesDataRelationshipsRulesDataItemsType type = + TeamRoutingRulesDataRelationshipsRulesDataItemsType.TEAM_ROUTING_RULES; + + public OnCallPageTeamRoutingRuleRelationshipData() {} + + @JsonCreator + public OnCallPageTeamRoutingRuleRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TeamRoutingRulesDataRelationshipsRulesDataItemsType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageTeamRoutingRuleRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the team routing rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageTeamRoutingRuleRelationshipData type( + TeamRoutingRulesDataRelationshipsRulesDataItemsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Indicates that the resource is of type team_routing_rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamRoutingRulesDataRelationshipsRulesDataItemsType getType() { + return type; + } + + public void setType(TeamRoutingRulesDataRelationshipsRulesDataItemsType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageTeamRoutingRuleRelationshipData + */ + @JsonAnySetter + public OnCallPageTeamRoutingRuleRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageTeamRoutingRuleRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageTeamRoutingRuleRelationshipData onCallPageTeamRoutingRuleRelationshipData = + (OnCallPageTeamRoutingRuleRelationshipData) o; + return Objects.equals(this.id, onCallPageTeamRoutingRuleRelationshipData.id) + && Objects.equals(this.type, onCallPageTeamRoutingRuleRelationshipData.type) + && Objects.equals( + this.additionalProperties, + onCallPageTeamRoutingRuleRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageTeamRoutingRuleRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPageUserRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPageUserRelationshipData.java new file mode 100644 index 00000000000..b09579b4f40 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPageUserRelationshipData.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Reference to a user. */ +@JsonPropertyOrder({ + OnCallPageUserRelationshipData.JSON_PROPERTY_ID, + OnCallPageUserRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPageUserRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ScheduleUserType type = ScheduleUserType.USERS; + + public OnCallPageUserRelationshipData() {} + + @JsonCreator + public OnCallPageUserRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ScheduleUserType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OnCallPageUserRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The user ID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public OnCallPageUserRelationshipData type(ScheduleUserType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Users resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ScheduleUserType getType() { + return type; + } + + public void setType(ScheduleUserType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPageUserRelationshipData + */ + @JsonAnySetter + public OnCallPageUserRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPageUserRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPageUserRelationshipData onCallPageUserRelationshipData = + (OnCallPageUserRelationshipData) o; + return Objects.equals(this.id, onCallPageUserRelationshipData.id) + && Objects.equals(this.type, onCallPageUserRelationshipData.type) + && Objects.equals( + this.additionalProperties, onCallPageUserRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPageUserRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPagesIncluded.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPagesIncluded.java new file mode 100644 index 00000000000..4db17c5647d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPagesIncluded.java @@ -0,0 +1,409 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = OnCallPagesIncluded.OnCallPagesIncludedDeserializer.class) +@JsonSerialize(using = OnCallPagesIncluded.OnCallPagesIncludedSerializer.class) +public class OnCallPagesIncluded extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(OnCallPagesIncluded.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class OnCallPagesIncludedSerializer extends StdSerializer { + public OnCallPagesIncludedSerializer(Class t) { + super(t); + } + + public OnCallPagesIncludedSerializer() { + this(null); + } + + @Override + public void serialize( + OnCallPagesIncluded value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class OnCallPagesIncludedDeserializer extends StdDeserializer { + public OnCallPagesIncludedDeserializer() { + this(OnCallPagesIncluded.class); + } + + public OnCallPagesIncludedDeserializer(Class vc) { + super(vc); + } + + @Override + public OnCallPagesIncluded deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ScheduleUser + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScheduleUser.class.equals(Integer.class) + || ScheduleUser.class.equals(Long.class) + || ScheduleUser.class.equals(Float.class) + || ScheduleUser.class.equals(Double.class) + || ScheduleUser.class.equals(Boolean.class) + || ScheduleUser.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((ScheduleUser.class.equals(Integer.class) || ScheduleUser.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ScheduleUser.class.equals(Float.class) || ScheduleUser.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (ScheduleUser.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ScheduleUser.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(ScheduleUser.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((ScheduleUser) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'ScheduleUser'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScheduleUser'", e); + } + + // deserialize TeamReference + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (TeamReference.class.equals(Integer.class) + || TeamReference.class.equals(Long.class) + || TeamReference.class.equals(Float.class) + || TeamReference.class.equals(Double.class) + || TeamReference.class.equals(Boolean.class) + || TeamReference.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((TeamReference.class.equals(Integer.class) + || TeamReference.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((TeamReference.class.equals(Float.class) + || TeamReference.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (TeamReference.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (TeamReference.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(TeamReference.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((TeamReference) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'TeamReference'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'TeamReference'", e); + } + + // deserialize OnCallPageScheduledAction + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (OnCallPageScheduledAction.class.equals(Integer.class) + || OnCallPageScheduledAction.class.equals(Long.class) + || OnCallPageScheduledAction.class.equals(Float.class) + || OnCallPageScheduledAction.class.equals(Double.class) + || OnCallPageScheduledAction.class.equals(Boolean.class) + || OnCallPageScheduledAction.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((OnCallPageScheduledAction.class.equals(Integer.class) + || OnCallPageScheduledAction.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((OnCallPageScheduledAction.class.equals(Float.class) + || OnCallPageScheduledAction.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (OnCallPageScheduledAction.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (OnCallPageScheduledAction.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(OnCallPageScheduledAction.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((OnCallPageScheduledAction) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'OnCallPageScheduledAction'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'OnCallPageScheduledAction'", e); + } + + // deserialize OnCallPageLink + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (OnCallPageLink.class.equals(Integer.class) + || OnCallPageLink.class.equals(Long.class) + || OnCallPageLink.class.equals(Float.class) + || OnCallPageLink.class.equals(Double.class) + || OnCallPageLink.class.equals(Boolean.class) + || OnCallPageLink.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((OnCallPageLink.class.equals(Integer.class) + || OnCallPageLink.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((OnCallPageLink.class.equals(Float.class) + || OnCallPageLink.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (OnCallPageLink.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (OnCallPageLink.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(OnCallPageLink.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((OnCallPageLink) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'OnCallPageLink'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'OnCallPageLink'", e); + } + + OnCallPagesIncluded ret = new OnCallPagesIncluded(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public OnCallPagesIncluded getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "OnCallPagesIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public OnCallPagesIncluded() { + super("oneOf", Boolean.FALSE); + } + + public OnCallPagesIncluded(ScheduleUser o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OnCallPagesIncluded(TeamReference o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OnCallPagesIncluded(OnCallPageScheduledAction o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public OnCallPagesIncluded(OnCallPageLink o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ScheduleUser", new GenericType() {}); + schemas.put("TeamReference", new GenericType() {}); + schemas.put("OnCallPageScheduledAction", new GenericType() {}); + schemas.put("OnCallPageLink", new GenericType() {}); + JSON.registerDescendants(OnCallPagesIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return OnCallPagesIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ScheduleUser, TeamReference, OnCallPageScheduledAction, + * OnCallPageLink + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ScheduleUser.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(TeamReference.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(OnCallPageScheduledAction.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(OnCallPageLink.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be ScheduleUser, TeamReference, OnCallPageScheduledAction," + + " OnCallPageLink"); + } + + /** + * Get the actual instance, which can be the following: ScheduleUser, TeamReference, + * OnCallPageScheduledAction, OnCallPageLink + * + * @return The actual instance (ScheduleUser, TeamReference, OnCallPageScheduledAction, + * OnCallPageLink) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ScheduleUser`. If the actual instance is not `ScheduleUser`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `ScheduleUser` + * @throws ClassCastException if the instance is not `ScheduleUser` + */ + public ScheduleUser getScheduleUser() throws ClassCastException { + return (ScheduleUser) super.getActualInstance(); + } + + /** + * Get the actual instance of `TeamReference`. If the actual instance is not `TeamReference`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `TeamReference` + * @throws ClassCastException if the instance is not `TeamReference` + */ + public TeamReference getTeamReference() throws ClassCastException { + return (TeamReference) super.getActualInstance(); + } + + /** + * Get the actual instance of `OnCallPageScheduledAction`. If the actual instance is not + * `OnCallPageScheduledAction`, the ClassCastException will be thrown. + * + * @return The actual instance of `OnCallPageScheduledAction` + * @throws ClassCastException if the instance is not `OnCallPageScheduledAction` + */ + public OnCallPageScheduledAction getOnCallPageScheduledAction() throws ClassCastException { + return (OnCallPageScheduledAction) super.getActualInstance(); + } + + /** + * Get the actual instance of `OnCallPageLink`. If the actual instance is not `OnCallPageLink`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OnCallPageLink` + * @throws ClassCastException if the instance is not `OnCallPageLink` + */ + public OnCallPageLink getOnCallPageLink() throws ClassCastException { + return (OnCallPageLink) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPagesResponse.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPagesResponse.java new file mode 100644 index 00000000000..2802f9125ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPagesResponse.java @@ -0,0 +1,241 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A list of On-Call Pages with pagination metadata and related included resources. */ +@JsonPropertyOrder({ + OnCallPagesResponse.JSON_PROPERTY_DATA, + OnCallPagesResponse.JSON_PROPERTY_INCLUDED, + OnCallPagesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OnCallPagesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_META = "meta"; + private SchedulesResponseMeta meta; + + public OnCallPagesResponse() {} + + @JsonCreator + public OnCallPagesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + for (OnCallPageData item : data) { + this.unparsed |= item.unparsed; + } + } + + public OnCallPagesResponse data(List data) { + this.data = data; + for (OnCallPageData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public OnCallPagesResponse addDataItem(OnCallPageData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of pages. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (OnCallPageData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + public OnCallPagesResponse included(List included) { + this.included = included; + if (included != null) { + for (OnCallPagesIncluded item : included) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public OnCallPagesResponse addIncludedItem(OnCallPagesIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Resources related to the pages, such as users, teams, and scheduled actions. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + if (included != null) { + for (OnCallPagesIncluded item : included) { + this.unparsed |= item.unparsed; + } + } + } + + public OnCallPagesResponse meta(SchedulesResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata that is included in the response when listing On-Call resources. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SchedulesResponseMeta getMeta() { + return meta; + } + + public void setMeta(SchedulesResponseMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return OnCallPagesResponse + */ + @JsonAnySetter + public OnCallPagesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this OnCallPagesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OnCallPagesResponse onCallPagesResponse = (OnCallPagesResponse) o; + return Objects.equals(this.data, onCallPagesResponse.data) + && Objects.equals(this.included, onCallPagesResponse.included) + && Objects.equals(this.meta, onCallPagesResponse.meta) + && Objects.equals(this.additionalProperties, onCallPagesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OnCallPagesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OnCallPagesSort.java b/src/main/java/com/datadog/api/client/v2/model/OnCallPagesSort.java new file mode 100644 index 00000000000..2b5483d7c57 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OnCallPagesSort.java @@ -0,0 +1,70 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Sorting options for pages. Prefix a field with - to sort in descending order. */ +@JsonSerialize(using = OnCallPagesSort.OnCallPagesSortSerializer.class) +public class OnCallPagesSort extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "created_at", + "-created_at", + "modified_at", + "-modified_at", + "status", + "-status", + "priority", + "-priority")); + + public static final OnCallPagesSort CREATED_AT_ASCENDING = new OnCallPagesSort("created_at"); + public static final OnCallPagesSort CREATED_AT_DESCENDING = new OnCallPagesSort("-created_at"); + public static final OnCallPagesSort MODIFIED_AT_ASCENDING = new OnCallPagesSort("modified_at"); + public static final OnCallPagesSort MODIFIED_AT_DESCENDING = new OnCallPagesSort("-modified_at"); + public static final OnCallPagesSort STATUS_ASCENDING = new OnCallPagesSort("status"); + public static final OnCallPagesSort STATUS_DESCENDING = new OnCallPagesSort("-status"); + public static final OnCallPagesSort PRIORITY_ASCENDING = new OnCallPagesSort("priority"); + public static final OnCallPagesSort PRIORITY_DESCENDING = new OnCallPagesSort("-priority"); + + OnCallPagesSort(String value) { + super(value, allowedValues); + } + + public static class OnCallPagesSortSerializer extends StdSerializer { + public OnCallPagesSortSerializer(Class t) { + super(t); + } + + public OnCallPagesSortSerializer() { + this(null); + } + + @Override + public void serialize(OnCallPagesSort value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OnCallPagesSort fromValue(String value) { + return new OnCallPagesSort(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OverrideData.java b/src/main/java/com/datadog/api/client/v2/model/OverrideData.java index 66e215ea227..b0c01858ead 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OverrideData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OverrideData.java @@ -128,7 +128,7 @@ public OverrideData type(OverrideDataType type) { } /** - * Indicates that the resource is of type 'overrides'. + * Indicates that the resource is of type overrides. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OverrideDataType.java b/src/main/java/com/datadog/api/client/v2/model/OverrideDataType.java index 9d4a3f72dae..c238d3e5536 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OverrideDataType.java +++ b/src/main/java/com/datadog/api/client/v2/model/OverrideDataType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the resource is of type 'overrides'. */ +/** Indicates that the resource is of type overrides. */ @JsonSerialize(using = OverrideDataType.OverrideDataTypeSerializer.class) public class OverrideDataType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleData.java b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleData.java index 4f877df2191..fa3eed4c853 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleData.java @@ -75,7 +75,7 @@ public OverrideRelationshipsScheduleData type(OverrideRelationshipsScheduleDataT } /** - * Indicates that the related resource is of type 'schedules'. + * Indicates that the related resource is of type schedules. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleDataType.java b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleDataType.java index 2c455cef39f..7b6883c0942 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleDataType.java +++ b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsScheduleDataType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the related resource is of type 'schedules'. */ +/** Indicates that the related resource is of type schedules. */ @JsonSerialize( using = OverrideRelationshipsScheduleDataType.OverrideRelationshipsScheduleDataTypeSerializer.class) diff --git a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserData.java b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserData.java index 812fae81d56..01d4d5a2f5d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserData.java @@ -71,7 +71,7 @@ public OverrideRelationshipsUserData type(OverrideRelationshipsUserDataType type } /** - * Indicates that the related resource is of type 'users'. + * Indicates that the related resource is of type users. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserDataType.java b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserDataType.java index 4bc758b9853..37c968c41d6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserDataType.java +++ b/src/main/java/com/datadog/api/client/v2/model/OverrideRelationshipsUserDataType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the related resource is of type 'users'. */ +/** Indicates that the related resource is of type users. */ @JsonSerialize( using = OverrideRelationshipsUserDataType.OverrideRelationshipsUserDataTypeSerializer.class) public class OverrideRelationshipsUserDataType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyData.java b/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyData.java index 657ff3199f1..2b7faf59e5c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyData.java +++ b/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyData.java @@ -72,7 +72,7 @@ public RoutingRuleRelationshipsPolicyData type(RoutingRuleRelationshipsPolicyDat } /** - * Indicates that the resource is of type 'policies'. + * Indicates that the resource is of type policies. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyDataType.java b/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyDataType.java index f52c7a1d3f3..9f480b18765 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyDataType.java +++ b/src/main/java/com/datadog/api/client/v2/model/RoutingRuleRelationshipsPolicyDataType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the resource is of type 'policies'. */ +/** Indicates that the resource is of type policies. */ @JsonSerialize( using = RoutingRuleRelationshipsPolicyDataType.RoutingRuleRelationshipsPolicyDataTypeSerializer diff --git a/src/main/java/com/datadog/api/client/v2/model/Schedules.java b/src/main/java/com/datadog/api/client/v2/model/Schedules.java index c6ae49a0b3d..6ad9ed8ed75 100644 --- a/src/main/java/com/datadog/api/client/v2/model/Schedules.java +++ b/src/main/java/com/datadog/api/client/v2/model/Schedules.java @@ -126,7 +126,7 @@ public Schedules meta(SchedulesResponseMeta meta) { } /** - * Metadata that is included in the response when listing schedules. + * Metadata that is included in the response when listing On-Call resources. * * @return meta */ diff --git a/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMeta.java index c67c593c476..cf150f39551 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMeta.java +++ b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMeta.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Metadata that is included in the response when listing schedules. */ +/** Metadata that is included in the response when listing On-Call resources. */ @JsonPropertyOrder({SchedulesResponseMeta.JSON_PROPERTY_PAGE}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -32,7 +32,8 @@ public SchedulesResponseMeta page(SchedulesResponseMetaPage page) { } /** - * Metadata related to paging information that is included in the response when listing schedules. + * Metadata related to pagination information that is included in the response when listing + * On-Call resources. * * @return page */ diff --git a/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMetaPage.java index 24247192e92..df348baaadc 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMetaPage.java +++ b/src/main/java/com/datadog/api/client/v2/model/SchedulesResponseMetaPage.java @@ -18,7 +18,8 @@ import org.openapitools.jackson.nullable.JsonNullable; /** - * Metadata related to paging information that is included in the response when listing schedules. + * Metadata related to pagination information that is included in the response when listing On-Call + * resources. */ @JsonPropertyOrder({ SchedulesResponseMetaPage.JSON_PROPERTY_FIRST_NUMBER, diff --git a/src/main/java/com/datadog/api/client/v2/model/ShiftData.java b/src/main/java/com/datadog/api/client/v2/model/ShiftData.java index 8c98440975f..de063427103 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ShiftData.java +++ b/src/main/java/com/datadog/api/client/v2/model/ShiftData.java @@ -126,7 +126,7 @@ public ShiftData type(ShiftDataType type) { } /** - * Indicates that the resource is of type 'shifts'. + * Indicates that the resource is of type shifts. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserData.java b/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserData.java index d266a29fd84..3d840823ab4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserData.java +++ b/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserData.java @@ -74,7 +74,7 @@ public ShiftDataRelationshipsUserData type(ShiftDataRelationshipsUserDataType ty } /** - * Indicates that the related resource is of type 'users'. + * Indicates that the related resource is of type users. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserDataType.java b/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserDataType.java index 5a52c5f25ee..0b6de2f1f3b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserDataType.java +++ b/src/main/java/com/datadog/api/client/v2/model/ShiftDataRelationshipsUserDataType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the related resource is of type 'users'. */ +/** Indicates that the related resource is of type users. */ @JsonSerialize( using = ShiftDataRelationshipsUserDataType.ShiftDataRelationshipsUserDataTypeSerializer.class) public class ShiftDataRelationshipsUserDataType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/ShiftDataType.java b/src/main/java/com/datadog/api/client/v2/model/ShiftDataType.java index 17fe7c45430..de697854de8 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ShiftDataType.java +++ b/src/main/java/com/datadog/api/client/v2/model/ShiftDataType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the resource is of type 'shifts'. */ +/** Indicates that the resource is of type shifts. */ @JsonSerialize(using = ShiftDataType.ShiftDataTypeSerializer.class) public class ShiftDataType extends ModelEnum { diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItems.java b/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItems.java index 0e02c7f239d..a43791dee2e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItems.java @@ -73,7 +73,7 @@ public TeamRoutingRulesDataRelationshipsRulesDataItems type( } /** - * Indicates that the resource is of type 'team_routing_rules'. + * Indicates that the resource is of type team_routing_rules. * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItemsType.java b/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItemsType.java index cc3f74a8efc..620ad4a57b4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItemsType.java +++ b/src/main/java/com/datadog/api/client/v2/model/TeamRoutingRulesDataRelationshipsRulesDataItemsType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** Indicates that the resource is of type 'team_routing_rules'. */ +/** Indicates that the resource is of type team_routing_rules. */ @JsonSerialize( using = TeamRoutingRulesDataRelationshipsRulesDataItemsType diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateOnCallNotificationRuleRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateOnCallNotificationRuleRequestData.java index 5d2cbf91db8..ac38b99a7d5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpdateOnCallNotificationRuleRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateOnCallNotificationRuleRequestData.java @@ -129,7 +129,7 @@ public UpdateOnCallNotificationRuleRequestData type(OnCallNotificationRuleType t } /** - * Indicates that the resource is of type 'notification_rules'. + * Indicates that the resource is of type notification_rules. * * @return type */ diff --git a/src/test/resources/com/datadog/api/client/v2/api/on-call.feature b/src/test/resources/com/datadog/api/client/v2/api/on-call.feature index f782b41d091..a791df40dce 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/on-call.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/on-call.feature @@ -272,6 +272,22 @@ Feature: On-Call When the request is sent Then the response status is 200 OK + @team:ddoghq/on-call + Scenario: Get On-Call page returns "Not Found" response + Given new "GetOnCallPage" request + And request contains "page_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:ddoghq/on-call + Scenario: Get On-Call page returns "OK" response + Given new "GetOnCallPage" request + And request contains "page_id" parameter with value "f63eb677-07ce-46ab-b2e0-80ca1ffe91bf" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "f63eb677-07ce-46ab-b2e0-80ca1ffe91bf" + And the response "data.type" is equal to "pages" + @generated @skip @team:ddoghq/on-call Scenario: Get On-Call schedule returns "Not Found" response Given new "GetOnCallSchedule" request @@ -505,6 +521,33 @@ Feature: On-Call And the response "data" has length 1 And the response "included" has length 1 + @generated @skip @team:ddoghq/on-call + Scenario: List On-Call pages returns "Bad Request" response + Given new "ListOnCallPages" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/on-call + Scenario: List On-Call pages returns "Not Found" response + Given new "ListOnCallPages" request + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:ddoghq/on-call + Scenario: List On-Call pages returns "OK" response + Given new "ListOnCallPages" request + And request contains "filter[query]" parameter with value "key:1" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "f63eb677-07ce-46ab-b2e0-80ca1ffe91bf" + + @generated @skip @team:ddoghq/on-call @with-pagination + Scenario: List On-Call pages returns "OK" response with pagination + Given new "ListOnCallPages" request + When the request with pagination is sent + Then the response status is 200 OK + @generated @skip @team:ddoghq/on-call Scenario: List On-Call schedule overrides returns "Bad Request" response Given new "ListScheduleOverrides" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/on-call_paging.feature b/src/test/resources/com/datadog/api/client/v2/api/on-call_paging.feature index fc26fabd4c1..472a4d9b29e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/on-call_paging.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/on-call_paging.feature @@ -10,29 +10,29 @@ Feature: On-Call Paging And an instance of "On-CallPaging" API @generated @skip @team:ddoghq/on-call - Scenario: Acknowledge On-Call Page returns "Accepted." response + Scenario: Acknowledge On-Call Page returns "No Content." response Given new "AcknowledgeOnCallPage" request And request contains "page_id" parameter from "REPLACE.ME" When the request is sent - Then the response status is 202 Accepted. + Then the response status is 204 No Content. @generated @skip @team:ddoghq/on-call - Scenario: Create On-Call Page returns "OK." response + Scenario: Create On-Call Page returns "Created." response Given new "CreateOnCallPage" request And body with value {"data": {"attributes": {"description": "Page details.", "tags": ["service:test"], "target": {"identifier": "my-team", "type": "team_handle"}, "title": "Page title", "urgency": "low"}, "type": "pages"}} When the request is sent - Then the response status is 200 OK. + Then the response status is 201 Created. @generated @skip @team:ddoghq/on-call - Scenario: Escalate On-Call Page returns "Accepted." response + Scenario: Escalate On-Call Page returns "No Content." response Given new "EscalateOnCallPage" request And request contains "page_id" parameter from "REPLACE.ME" When the request is sent - Then the response status is 202 Accepted. + Then the response status is 204 No Content. @generated @skip @team:ddoghq/on-call - Scenario: Resolve On-Call Page returns "Accepted." response + Scenario: Resolve On-Call Page returns "No Content." response Given new "ResolveOnCallPage" request And request contains "page_id" parameter from "REPLACE.ME" When the request is sent - Then the response status is 202 Accepted. + Then the response status is 204 No Content. diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 37961c9528f..23ef37ab6f5 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -6693,6 +6693,12 @@ "type": "idempotent" } }, + "ListOnCallPages": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, "CreateOnCallPage": { "tag": "On-Call Paging", "undo": { @@ -6700,6 +6706,12 @@ "type": "unsafe" } }, + "GetOnCallPage": { + "tag": "On-Call", + "undo": { + "type": "safe" + } + }, "AcknowledgeOnCallPage": { "tag": "On-Call Paging", "undo": { diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index b6576142c44..a4c2f33e1b5 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -8946,6 +8946,20 @@ "scenario": "Get On-Call escalation policy returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "feature_file": "../../com/datadog/api/client/v2/api/on-call.feature", + "file": "v2/on-call/get-on-call-page-returns-not-found-response.json", + "scenario": "Get On-Call page returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "On-Call", + "feature_file": "../../com/datadog/api/client/v2/api/on-call.feature", + "file": "v2/on-call/get-on-call-page-returns-ok-response.json", + "scenario": "Get On-Call page returns \"OK\" response", + "version": "v2" + }, { "feature": "On-Call", "feature_file": "../../com/datadog/api/client/v2/api/on-call.feature", @@ -9009,6 +9023,13 @@ "scenario": "List On-Call notification rules for a user returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "feature_file": "../../com/datadog/api/client/v2/api/on-call.feature", + "file": "v2/on-call/list-on-call-pages-returns-ok-response.json", + "scenario": "List On-Call pages returns \"OK\" response", + "version": "v2" + }, { "feature": "On-Call", "feature_file": "../../com/datadog/api/client/v2/api/on-call.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-not-found-response.json b/src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-not-found-response.json new file mode 100644 index 00000000000..9f874f55ebc --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-not-found-response.json @@ -0,0 +1,35 @@ +{ + "api": "On-Call", + "expected_status": 404, + "feature": "On-Call", + "id": "v2/On-Call/Get On-Call page returns \"Not Found\" response", + "operation_id": "GetOnCallPage", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "page_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "00000000-0000-0000-0000-000000000000" + }, + "style": null + } + ], + "path": "/api/v2/on-call/pages/{page_id}" + }, + "scenario": "Get On-Call page returns \"Not Found\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-ok-response.json new file mode 100644 index 00000000000..5054681a069 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/on-call/get-on-call-page-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "On-Call", + "expected_status": 200, + "feature": "On-Call", + "id": "v2/On-Call/Get On-Call page returns \"OK\" response", + "operation_id": "GetOnCallPage", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "page_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "f63eb677-07ce-46ab-b2e0-80ca1ffe91bf" + }, + "style": null + } + ], + "path": "/api/v2/on-call/pages/{page_id}" + }, + "scenario": "Get On-Call page returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-pages-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-pages-returns-ok-response.json new file mode 100644 index 00000000000..3666244b81a --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/on-call/list-on-call-pages-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "On-Call", + "expected_status": 200, + "feature": "On-Call", + "id": "v2/On-Call/List On-Call pages returns \"OK\" response", + "operation_id": "ListOnCallPages", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "query", + "name": "filter[query]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "key:1" + }, + "style": null + } + ], + "path": "/api/v2/on-call/pages" + }, + "scenario": "List On-Call pages returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/on-call.json b/src/test/resources/generated-test/test-server-data/v2/on-call.json index a6fe6f6f7cc..74b396ae06e 100644 --- a/src/test/resources/generated-test/test-server-data/v2/on-call.json +++ b/src/test/resources/generated-test/test-server-data/v2/on-call.json @@ -2480,6 +2480,68 @@ "scenario": "Get On-Call escalation policy returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "frozen_at": "2026-10-19T12:37:39.340Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/on-call/pages/00000000-0000-0000-0000-000000000000", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Get On-Call page returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "On-Call", + "frozen_at": "2026-10-19T14:39:38.375Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/on-call/pages/f63eb677-07ce-46ab-b2e0-80ca1ffe91bf", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"f63eb677-07ce-46ab-b2e0-80ca1ffe91bf\",\"type\":\"pages\",\"attributes\":{\"acknowledged_at\":\"2026-09-11T10:13:30.188151252Z\",\"created_at\":\"2026-09-11T10:13:30.043027Z\",\"description\":\"\",\"escalation_policy_uuid\":\"b3a7d0b9-536b-4949-be2b-dc6ec6bbb776\",\"key\":\"1\",\"modified_at\":\"2026-09-11T10:13:30.188151Z\",\"services\":[\"test\"],\"status\":\"acknowledged\",\"tags\":[\"service:test\"],\"title\":\"Test-Acknowledge_On_Call_Page_returns_Accepted_response-1789121607\",\"urgency\":\"low\"},\"relationships\":{\"author\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"closed_by\":{\"data\":null},\"links\":{\"data\":[]},\"responders\":{\"data\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}]},\"scheduled_action\":{\"data\":{\"id\":\"f63eb677-07ce-46ab-b2e0-80ca1ffe91bf\",\"type\":\"scheduled_actions\"}},\"target\":{\"data\":{\"id\":\"8678409c-3645-48d3-b330-a9ab6d70c6ff\",\"type\":\"teams\"}},\"team_routing_rule\":{\"data\":{\"id\":\"b2a6c72b-fdb3-4ce7-b07b-dd84af0303e9\",\"type\":\"team_routing_rules\"}}}},\"included\":[{\"id\":\"f63eb677-07ce-46ab-b2e0-80ca1ffe91bf\",\"type\":\"scheduled_actions\",\"attributes\":{\"type\":\"escalate\"},\"relationships\":{\"schedules\":{\"data\":[]},\"users\":{\"data\":[]}}},{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"name\":\"CI Account\",\"status\":\"active\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Get On-Call page returns \"OK\" response", + "version": "v2" + }, { "feature": "On-Call", "frozen_at": "2025-11-27T14:11:37.612Z", @@ -4290,6 +4352,42 @@ "scenario": "List On-Call notification rules for a user returns \"OK\" response", "version": "v2" }, + { + "feature": "On-Call", + "frozen_at": "2026-10-19T14:46:40.993Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/on-call/pages", + "query": [ + [ + "filter[query]", + "key:1" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"f63eb677-07ce-46ab-b2e0-80ca1ffe91bf\",\"type\":\"pages\",\"attributes\":{\"acknowledged_at\":\"2026-09-11T10:13:30.188151252Z\",\"created_at\":\"2026-09-11T10:13:30.043027Z\",\"description\":\"\",\"escalation_policy_uuid\":\"b3a7d0b9-536b-4949-be2b-dc6ec6bbb776\",\"key\":\"1\",\"modified_at\":\"2026-09-11T10:13:30.188151252Z\",\"services\":[\"test\"],\"status\":\"acknowledged\",\"tags\":[\"service:test\"],\"title\":\"Test-Acknowledge_On_Call_Page_returns_Accepted_response-1789121607\",\"urgency\":\"low\"},\"relationships\":{\"author\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}},\"closed_by\":{\"data\":null},\"links\":{\"data\":[]},\"responders\":{\"data\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\"}]},\"scheduled_action\":{\"data\":{\"id\":\"f63eb677-07ce-46ab-b2e0-80ca1ffe91bf\",\"type\":\"scheduled_actions\"}},\"target\":{\"data\":{\"id\":\"8678409c-3645-48d3-b330-a9ab6d70c6ff\",\"type\":\"teams\"}},\"team_routing_rule\":{\"data\":{\"id\":\"b2a6c72b-fdb3-4ce7-b07b-dd84af0303e9\",\"type\":\"team_routing_rules\"}}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":0,\"size\":100,\"total\":1,\"first_number\":0,\"prev_number\":null,\"next_number\":null,\"last_number\":0}},\"included\":[{\"id\":\"f63eb677-07ce-46ab-b2e0-80ca1ffe91bf\",\"type\":\"scheduled_actions\",\"attributes\":{\"type\":\"escalate\"},\"relationships\":{\"schedules\":{\"data\":[]},\"users\":{\"data\":[]}}},{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"users\",\"attributes\":{\"email\":\"team-intg-tools-libs-spam@datadoghq.com\",\"name\":\"CI Account\",\"status\":\"active\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "List On-Call pages returns \"OK\" response", + "version": "v2" + }, { "feature": "On-Call", "frozen_at": "2026-10-06T08:43:24.486Z",