From 05b30661c7fd9d97d59d37385d5d0c73489339ce Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 8 Sep 2025 18:23:44 +0000 Subject: [PATCH] Regenerate client from commit 6f3b8e8 of spec repo --- .generator/schemas/v2/openapi.yaml | 613 +++++++ .../CreateIncidentNotificationTemplate.java | 66 + .../DeleteIncidentNotificationTemplate.java | 25 + ...cidentNotificationTemplate_1602689347.java | 33 + .../GetIncidentNotificationTemplate.java | 36 + .../ListIncidentNotificationTemplates.java | 25 + .../UpdateIncidentNotificationTemplate.java | 64 + .../com/datadog/api/client/ApiClient.java | 5 + .../api/client/v2/api/IncidentsApi.java | 1474 ++++++++++++++--- ...teIncidentNotificationTemplateRequest.java | 150 ++ .../GoogleMeetConfigurationReference.java | 153 ++ .../GoogleMeetConfigurationReferenceData.java | 175 ++ .../model/IncidentNotificationTemplate.java | 192 +++ .../IncidentNotificationTemplateArray.java | 230 +++ ...IncidentNotificationTemplateArrayMeta.java | 139 ++ ...dentNotificationTemplateArrayMetaPage.java | 168 ++ ...ncidentNotificationTemplateAttributes.java | 270 +++ ...tNotificationTemplateCreateAttributes.java | 233 +++ ...ncidentNotificationTemplateCreateData.java | 214 +++ ...cationTemplateCreateDataRelationships.java | 147 ++ ...dentNotificationTemplateIncludedItems.java | 287 ++++ ...dentNotificationTemplateRelationships.java | 201 +++ ...identNotificationTemplateResponseData.java | 242 +++ .../IncidentNotificationTemplateType.java | 58 + ...tNotificationTemplateUpdateAttributes.java | 222 +++ ...ncidentNotificationTemplateUpdateData.java | 211 +++ .../client/v2/model/IncidentTypeObject.java | 30 +- .../v2/model/IncidentTypeRelationships.java | 306 ++++ .../MicrosoftTeamsConfigurationReference.java | 153 ++ ...rosoftTeamsConfigurationReferenceData.java | 176 ++ ...chIncidentNotificationTemplateRequest.java | 150 ++ .../v2/model/RelationshipToIncidentType.java | 147 ++ .../model/RelationshipToIncidentTypeData.java | 180 ++ .../v2/model/ZoomConfigurationReference.java | 152 ++ .../model/ZoomConfigurationReferenceData.java | 175 ++ ...ncident_type_returns_CREATED_response.json | 2 +- ...mplate_returns_Bad_Request_response.freeze | 1 + ...template_returns_Bad_Request_response.json | 32 + ...n_template_returns_Created_response.freeze | 1 + ...ion_template_returns_Created_response.json | 104 ++ ...template_returns_Not_Found_response.freeze | 1 + ...n_template_returns_Not_Found_response.json | 32 + ..._an_incident_type_returns_OK_response.json | 2 +- ...emplate_returns_No_Content_response.freeze | 1 + ..._template_returns_No_Content_response.json | 130 ++ ...cation_template_returns_OK_response.freeze | 1 + ...fication_template_returns_OK_response.json | 130 ++ ...ation_templates_returns_OK_response.freeze | 1 + ...ication_templates_returns_OK_response.json | 28 + ..._an_incident_type_returns_OK_response.json | 2 +- ...mplate_returns_Bad_Request_response.freeze | 1 + ...template_returns_Bad_Request_response.json | 32 + ...template_returns_Not_Found_response.freeze | 1 + ...n_template_returns_Not_Found_response.json | 32 + ...cation_template_returns_OK_response.freeze | 1 + ...fication_template_returns_OK_response.json | 134 ++ .../com/datadog/api/client/v2/api/given.json | 12 + .../api/client/v2/api/incidents.feature | 148 ++ .../com/datadog/api/client/v2/api/undo.json | 37 + 59 files changed, 7771 insertions(+), 197 deletions(-) create mode 100644 examples/v2/incidents/CreateIncidentNotificationTemplate.java create mode 100644 examples/v2/incidents/DeleteIncidentNotificationTemplate.java create mode 100644 examples/v2/incidents/DeleteIncidentNotificationTemplate_1602689347.java create mode 100644 examples/v2/incidents/GetIncidentNotificationTemplate.java create mode 100644 examples/v2/incidents/ListIncidentNotificationTemplates.java create mode 100644 examples/v2/incidents/UpdateIncidentNotificationTemplate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CreateIncidentNotificationTemplateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GoogleMeetConfigurationReference.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GoogleMeetConfigurationReferenceData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArray.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArrayMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArrayMetaPage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateDataRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateIncludedItems.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateUpdateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IncidentTypeRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsConfigurationReference.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsConfigurationReferenceData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchIncidentNotificationTemplateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentTypeData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ZoomConfigurationReference.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ZoomConfigurationReferenceData.java create mode 100644 src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2f4dce9e3c2..21a2d895b20 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -485,6 +485,37 @@ components: required: true schema: type: string + IncidentNotificationTemplateIDPathParameter: + description: The ID of the notification template. + in: path + name: id + required: true + schema: + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + IncidentNotificationTemplateIncidentTypeFilterQueryParameter: + description: Optional incident type ID filter. + explode: false + in: query + name: filter[incident-type] + required: false + schema: + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + IncidentNotificationTemplateIncludeQueryParameter: + description: 'Comma-separated list of relationships to include. Supported values: + `created_by_user`, `last_modified_by_user`, `incident_type` + + ' + explode: false + in: query + name: include + required: false + schema: + example: created_by_user,incident_type + type: string IncidentSearchIncludeQueryParameter: description: Specifies which types of related objects should be included in the response. @@ -10820,6 +10851,14 @@ components: meta: $ref: '#/components/schemas/DataDeletionResponseMeta' type: object + CreateIncidentNotificationTemplateRequest: + description: Create request for a notification template. + properties: + data: + $ref: '#/components/schemas/IncidentNotificationTemplateCreateData' + required: + - data + type: object CreateNotificationRuleParameters: description: Body of the notification rule create request. properties: @@ -18550,6 +18589,31 @@ components: required: - type type: object + GoogleMeetConfigurationReference: + description: A reference to a Google Meet Configuration resource. + nullable: true + properties: + data: + $ref: '#/components/schemas/GoogleMeetConfigurationReferenceData' + required: + - data + type: object + GoogleMeetConfigurationReferenceData: + description: The Google Meet configuration relationship data object. + nullable: true + properties: + id: + description: The unique identifier of the Google Meet configuration. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + description: The type of the Google Meet configuration. + example: google_meet_configurations + type: string + required: + - id + - type + type: object GreyNoiseAPIKey: description: The definition of the `GreyNoiseAPIKey` object. properties: @@ -19875,6 +19939,256 @@ components: example: '@test.user@test.com' type: string type: object + IncidentNotificationTemplate: + description: Response with a notification template. + properties: + data: + $ref: '#/components/schemas/IncidentNotificationTemplateResponseData' + included: + description: Related objects that are included in the response. + items: + $ref: '#/components/schemas/IncidentNotificationTemplateIncludedItems' + type: array + required: + - data + type: object + IncidentNotificationTemplateArray: + description: Response with notification templates. + properties: + data: + description: The `NotificationTemplateArray` `data`. + items: + $ref: '#/components/schemas/IncidentNotificationTemplateResponseData' + type: array + included: + description: Related objects that are included in the response. + items: + $ref: '#/components/schemas/IncidentNotificationTemplateIncludedItems' + type: array + meta: + $ref: '#/components/schemas/IncidentNotificationTemplateArrayMeta' + required: + - data + type: object + IncidentNotificationTemplateArrayMeta: + description: Response metadata. + properties: + page: + $ref: '#/components/schemas/IncidentNotificationTemplateArrayMetaPage' + type: object + IncidentNotificationTemplateArrayMetaPage: + description: Pagination metadata. + properties: + total_count: + description: Total number of notification templates. + example: 42 + format: int64 + type: integer + total_filtered_count: + description: Total number of notification templates matching the filter. + example: 15 + format: int64 + type: integer + type: object + IncidentNotificationTemplateAttributes: + description: The notification template's attributes. + properties: + category: + description: The category of the notification template. + example: alert + type: string + content: + description: The content body of the notification template. + example: 'An incident has been declared. + + + Title: {{incident.title}} + + Severity: {{incident.severity}} + + Affected Services: {{incident.services}} + + Status: {{incident.state}} + + + Please join the incident channel for updates.' + type: string + created: + description: Timestamp when the notification template was created. + example: '2025-01-15T10:30:00Z' + format: date-time + readOnly: true + type: string + modified: + description: Timestamp when the notification template was last modified. + example: '2025-01-15T14:45:00Z' + format: date-time + readOnly: true + type: string + name: + description: The name of the notification template. + example: Incident Alert Template + type: string + subject: + description: The subject line of the notification template. + example: '{{incident.severity}} Incident: {{incident.title}}' + type: string + required: + - name + - subject + - content + - category + - created + - modified + type: object + IncidentNotificationTemplateCreateAttributes: + description: The attributes for creating a notification template. + properties: + category: + description: The category of the notification template. + example: alert + type: string + content: + description: The content body of the notification template. + example: 'An incident has been declared. + + + Title: {{incident.title}} + + Severity: {{incident.severity}} + + Affected Services: {{incident.services}} + + Status: {{incident.state}} + + + Please join the incident channel for updates.' + type: string + name: + description: The name of the notification template. + example: Incident Alert Template + type: string + subject: + description: The subject line of the notification template. + example: '{{incident.severity}} Incident: {{incident.title}}' + type: string + required: + - name + - subject + - content + - category + type: object + IncidentNotificationTemplateCreateData: + description: Notification template data for a create request. + properties: + attributes: + $ref: '#/components/schemas/IncidentNotificationTemplateCreateAttributes' + relationships: + $ref: '#/components/schemas/IncidentNotificationTemplateCreateDataRelationships' + type: + $ref: '#/components/schemas/IncidentNotificationTemplateType' + required: + - type + - attributes + type: object + IncidentNotificationTemplateCreateDataRelationships: + description: The definition of `NotificationTemplateCreateDataRelationships` + object. + properties: + incident_type: + $ref: '#/components/schemas/RelationshipToIncidentType' + type: object + IncidentNotificationTemplateIncludedItems: + description: Objects related to a notification template. + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/IncidentTypeObject' + IncidentNotificationTemplateRelationships: + description: The notification template's resource relationships. + properties: + created_by_user: + $ref: '#/components/schemas/RelationshipToUser' + incident_type: + $ref: '#/components/schemas/RelationshipToIncidentType' + last_modified_by_user: + $ref: '#/components/schemas/RelationshipToUser' + type: object + IncidentNotificationTemplateResponseData: + description: Notification template data from a response. + properties: + attributes: + $ref: '#/components/schemas/IncidentNotificationTemplateAttributes' + id: + description: The unique identifier of the notification template. + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + relationships: + $ref: '#/components/schemas/IncidentNotificationTemplateRelationships' + type: + $ref: '#/components/schemas/IncidentNotificationTemplateType' + required: + - id + - type + type: object + IncidentNotificationTemplateType: + description: Notification templates resource type. + enum: + - notification_templates + example: notification_templates + type: string + x-enum-varnames: + - NOTIFICATION_TEMPLATES + IncidentNotificationTemplateUpdateAttributes: + description: The attributes to update on a notification template. + properties: + category: + description: The category of the notification template. + example: update + type: string + content: + description: The content body of the notification template. + example: 'Incident Status Update: + + + Title: {{incident.title}} + + New Status: {{incident.state}} + + Severity: {{incident.severity}} + + Services: {{incident.services}} + + Commander: {{incident.commander}} + + + For more details, visit the incident page.' + type: string + name: + description: The name of the notification template. + example: Incident Status Update Template + type: string + subject: + description: The subject line of the notification template. + example: 'Incident Update: {{incident.title}} - {{incident.state}}' + type: string + type: object + IncidentNotificationTemplateUpdateData: + description: Notification template data for an update request. + properties: + attributes: + $ref: '#/components/schemas/IncidentNotificationTemplateUpdateAttributes' + id: + description: The unique identifier of the notification template. + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + type: + $ref: '#/components/schemas/IncidentNotificationTemplateType' + required: + - id + - type + type: object IncidentPostmortemType: default: incident_postmortems description: Incident postmortem resource type. @@ -21034,6 +21348,8 @@ components: description: The incident type's ID. example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: '#/components/schemas/IncidentTypeRelationships' type: $ref: '#/components/schemas/IncidentTypeType' required: @@ -21064,6 +21380,21 @@ components: required: - data type: object + IncidentTypeRelationships: + additionalProperties: {} + description: The incident type's resource relationships. + properties: + created_by_user: + $ref: '#/components/schemas/RelationshipToUser' + google_meet_configuration: + $ref: '#/components/schemas/GoogleMeetConfigurationReference' + last_modified_by_user: + $ref: '#/components/schemas/RelationshipToUser' + microsoft_teams_configuration: + $ref: '#/components/schemas/MicrosoftTeamsConfigurationReference' + zoom_configuration: + $ref: '#/components/schemas/ZoomConfigurationReference' + type: object IncidentTypeResponse: description: Incident type response data. properties: @@ -26067,6 +26398,31 @@ components: type: string x-enum-varnames: - MS_TEAMS_CHANNEL_INFO + MicrosoftTeamsConfigurationReference: + description: A reference to a Microsoft Teams Configuration resource. + nullable: true + properties: + data: + $ref: '#/components/schemas/MicrosoftTeamsConfigurationReferenceData' + required: + - data + type: object + MicrosoftTeamsConfigurationReferenceData: + description: The Microsoft Teams configuration relationship data object. + nullable: true + properties: + id: + description: The unique identifier of the Microsoft Teams configuration. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + description: The type of the Microsoft Teams configuration. + example: microsoft_teams_configurations + type: string + required: + - id + - type + type: object MicrosoftTeamsCreateTenantBasedHandleRequest: description: Create tenant-based handle request. properties: @@ -32455,6 +32811,14 @@ components: $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' type: array type: object + PatchIncidentNotificationTemplateRequest: + description: Update request for a notification template. + properties: + data: + $ref: '#/components/schemas/IncidentNotificationTemplateUpdateData' + required: + - data + type: object PatchNotificationRuleParameters: description: Body of the notification rule patch request. properties: @@ -34362,6 +34726,27 @@ components: required: - data type: object + RelationshipToIncidentType: + description: Relationship to an incident type. + properties: + data: + $ref: '#/components/schemas/RelationshipToIncidentTypeData' + required: + - data + type: object + RelationshipToIncidentTypeData: + description: Relationship to incident type object. + properties: + id: + description: The incident type's ID. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/IncidentTypeType' + required: + - id + - type + type: object RelationshipToIncidentUserDefinedFieldData: description: Relationship to impact object. properties: @@ -46811,6 +47196,31 @@ components: oneOf: - $ref: '#/components/schemas/XRayServicesIncludeAll' - $ref: '#/components/schemas/XRayServicesIncludeOnly' + ZoomConfigurationReference: + description: A reference to a Zoom configuration resource. + nullable: true + properties: + data: + $ref: '#/components/schemas/ZoomConfigurationReferenceData' + required: + - data + type: object + ZoomConfigurationReferenceData: + description: The Zoom configuration relationship data object. + nullable: true + properties: + id: + description: The unique identifier of the Zoom configuration. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + description: The type of the Zoom configuration. + example: zoom_configurations + type: string + required: + - id + - type + type: object securitySchemes: AuthZ: description: This API uses OAuth 2 with the implicit grant flow. @@ -46860,6 +47270,7 @@ components: incident_notification_settings_write: Configure Incidents Notification settings. incident_read: View incidents in Datadog. + incident_settings_read: View Incident Settings. incident_settings_write: Configure Incident Settings. incident_write: Create, view, and manage incidents in Datadog. metrics_read: View custom metrics. @@ -53787,6 +54198,208 @@ paths: - incident_write x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/config/notification-templates: + get: + description: Lists all notification templates. Optionally filter by incident + type. + operationId: ListIncidentNotificationTemplates + parameters: + - $ref: '#/components/parameters/IncidentNotificationTemplateIncidentTypeFilterQueryParameter' + - $ref: '#/components/parameters/IncidentNotificationTemplateIncludeQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentNotificationTemplateArray' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: List incident notification templates + tags: + - Incidents + x-permission: + operator: AND + permissions: + - incident_notification_settings_read + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Creates a new notification template. + operationId: CreateIncidentNotificationTemplate + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateIncidentNotificationTemplateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentNotificationTemplate' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_notification_settings_write + summary: Create incident notification template + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - incident_notification_settings_write + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/config/notification-templates/{id}: + delete: + description: Deletes a notification template by its ID. + operationId: DeleteIncidentNotificationTemplate + parameters: + - $ref: '#/components/parameters/IncidentNotificationTemplateIDPathParameter' + - $ref: '#/components/parameters/IncidentNotificationTemplateIncludeQueryParameter' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_notification_settings_write + summary: Delete a notification template + tags: + - Incidents + x-permission: + operator: AND + permissions: + - incident_notification_settings_write + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Retrieves a specific notification template by its ID. + operationId: GetIncidentNotificationTemplate + parameters: + - $ref: '#/components/parameters/IncidentNotificationTemplateIDPathParameter' + - $ref: '#/components/parameters/IncidentNotificationTemplateIncludeQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentNotificationTemplate' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: Get incident notification template + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_read + - incident_write + - incident_read + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Updates an existing notification template's attributes. + operationId: UpdateIncidentNotificationTemplate + parameters: + - $ref: '#/components/parameters/IncidentNotificationTemplateIDPathParameter' + - $ref: '#/components/parameters/IncidentNotificationTemplateIncludeQueryParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchIncidentNotificationTemplateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentNotificationTemplate' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_notification_settings_write + summary: Update incident notification template + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - incident_notification_settings_write + x-unstable: '**Note**: This endpoint is in Preview. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/config/types: get: diff --git a/examples/v2/incidents/CreateIncidentNotificationTemplate.java b/examples/v2/incidents/CreateIncidentNotificationTemplate.java new file mode 100644 index 00000000000..59f8d7cf70e --- /dev/null +++ b/examples/v2/incidents/CreateIncidentNotificationTemplate.java @@ -0,0 +1,66 @@ +// Create incident notification template returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.CreateIncidentNotificationTemplateRequest; +import com.datadog.api.client.v2.model.IncidentNotificationTemplate; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateCreateAttributes; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateCreateData; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateCreateDataRelationships; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateType; +import com.datadog.api.client.v2.model.IncidentTypeType; +import com.datadog.api.client.v2.model.RelationshipToIncidentType; +import com.datadog.api.client.v2.model.RelationshipToIncidentTypeData; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createIncidentNotificationTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + // there is a valid "incident_type" in the system + String INCIDENT_TYPE_DATA_ID = System.getenv("INCIDENT_TYPE_DATA_ID"); + + CreateIncidentNotificationTemplateRequest body = + new CreateIncidentNotificationTemplateRequest() + .data( + new IncidentNotificationTemplateCreateData() + .attributes( + new IncidentNotificationTemplateCreateAttributes() + .category("alert") + .content( + """ +An incident has been declared. + +Title: Sample Incident Title +Severity: SEV-2 +Affected Services: web-service, database-service +Status: active + +Please join the incident channel for updates. +""") + .name("Example-Incident") + .subject("SEV-2 Incident: Sample Incident Title")) + .relationships( + new IncidentNotificationTemplateCreateDataRelationships() + .incidentType( + new RelationshipToIncidentType() + .data( + new RelationshipToIncidentTypeData() + .id(INCIDENT_TYPE_DATA_ID) + .type(IncidentTypeType.INCIDENT_TYPES)))) + .type(IncidentNotificationTemplateType.NOTIFICATION_TEMPLATES)); + + try { + IncidentNotificationTemplate result = apiInstance.createIncidentNotificationTemplate(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#createIncidentNotificationTemplate"); + 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/incidents/DeleteIncidentNotificationTemplate.java b/examples/v2/incidents/DeleteIncidentNotificationTemplate.java new file mode 100644 index 00000000000..0e9ea61d6d3 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentNotificationTemplate.java @@ -0,0 +1,25 @@ +// Delete a notification template returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteIncidentNotificationTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + apiInstance.deleteIncidentNotificationTemplate( + UUID.fromString("00000000-0000-0000-0000-000000000001")); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#deleteIncidentNotificationTemplate"); + 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/incidents/DeleteIncidentNotificationTemplate_1602689347.java b/examples/v2/incidents/DeleteIncidentNotificationTemplate_1602689347.java new file mode 100644 index 00000000000..a3de39a5c48 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentNotificationTemplate_1602689347.java @@ -0,0 +1,33 @@ +// Delete incident notification template returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteIncidentNotificationTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + // there is a valid "notification_template" in the system + UUID NOTIFICATION_TEMPLATE_DATA_ID = null; + try { + NOTIFICATION_TEMPLATE_DATA_ID = + UUID.fromString(System.getenv("NOTIFICATION_TEMPLATE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + apiInstance.deleteIncidentNotificationTemplate(NOTIFICATION_TEMPLATE_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#deleteIncidentNotificationTemplate"); + 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/incidents/GetIncidentNotificationTemplate.java b/examples/v2/incidents/GetIncidentNotificationTemplate.java new file mode 100644 index 00000000000..49a611f8549 --- /dev/null +++ b/examples/v2/incidents/GetIncidentNotificationTemplate.java @@ -0,0 +1,36 @@ +// Get incident notification template returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentNotificationTemplate; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getIncidentNotificationTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + // there is a valid "notification_template" in the system + UUID NOTIFICATION_TEMPLATE_DATA_ID = null; + try { + NOTIFICATION_TEMPLATE_DATA_ID = + UUID.fromString(System.getenv("NOTIFICATION_TEMPLATE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + IncidentNotificationTemplate result = + apiInstance.getIncidentNotificationTemplate(NOTIFICATION_TEMPLATE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#getIncidentNotificationTemplate"); + 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/incidents/ListIncidentNotificationTemplates.java b/examples/v2/incidents/ListIncidentNotificationTemplates.java new file mode 100644 index 00000000000..ca29491042e --- /dev/null +++ b/examples/v2/incidents/ListIncidentNotificationTemplates.java @@ -0,0 +1,25 @@ +// List incident notification templates returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateArray; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listIncidentNotificationTemplates", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + try { + IncidentNotificationTemplateArray result = apiInstance.listIncidentNotificationTemplates(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#listIncidentNotificationTemplates"); + 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/incidents/UpdateIncidentNotificationTemplate.java b/examples/v2/incidents/UpdateIncidentNotificationTemplate.java new file mode 100644 index 00000000000..167e435f205 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentNotificationTemplate.java @@ -0,0 +1,64 @@ +// Update incident notification template returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.IncidentsApi; +import com.datadog.api.client.v2.model.IncidentNotificationTemplate; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateType; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateUpdateAttributes; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateUpdateData; +import com.datadog.api.client.v2.model.PatchIncidentNotificationTemplateRequest; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateIncidentNotificationTemplate", true); + IncidentsApi apiInstance = new IncidentsApi(defaultClient); + + // there is a valid "notification_template" in the system + UUID NOTIFICATION_TEMPLATE_DATA_ID = null; + try { + NOTIFICATION_TEMPLATE_DATA_ID = + UUID.fromString(System.getenv("NOTIFICATION_TEMPLATE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + PatchIncidentNotificationTemplateRequest body = + new PatchIncidentNotificationTemplateRequest() + .data( + new IncidentNotificationTemplateUpdateData() + .attributes( + new IncidentNotificationTemplateUpdateAttributes() + .category("update") + .content( + """ +Incident Status Update: + +Title: Sample Incident Title +New Status: resolved +Severity: SEV-2 +Services: web-service, database-service +Commander: John Doe + +For more details, visit the incident page. +""") + .name("Example-Incident") + .subject("Incident Update: Sample Incident Title - resolved")) + .id(NOTIFICATION_TEMPLATE_DATA_ID) + .type(IncidentNotificationTemplateType.NOTIFICATION_TEMPLATES)); + + try { + IncidentNotificationTemplate result = + apiInstance.updateIncidentNotificationTemplate(NOTIFICATION_TEMPLATE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling IncidentsApi#updateIncidentNotificationTemplate"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 296e4dcb148..73c504434d1 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -720,18 +720,22 @@ public class ApiClient { put("v2.getDataDeletionRequests", false); put("v2.createIncident", false); put("v2.createIncidentIntegration", false); + put("v2.createIncidentNotificationTemplate", false); put("v2.createIncidentTodo", false); put("v2.createIncidentType", false); put("v2.deleteIncident", false); put("v2.deleteIncidentIntegration", false); + put("v2.deleteIncidentNotificationTemplate", false); put("v2.deleteIncidentTodo", false); put("v2.deleteIncidentType", false); put("v2.getIncident", false); put("v2.getIncidentIntegration", false); + put("v2.getIncidentNotificationTemplate", false); put("v2.getIncidentTodo", false); put("v2.getIncidentType", false); put("v2.listIncidentAttachments", false); put("v2.listIncidentIntegrations", false); + put("v2.listIncidentNotificationTemplates", false); put("v2.listIncidents", false); put("v2.listIncidentTodos", false); put("v2.listIncidentTypes", false); @@ -739,6 +743,7 @@ public class ApiClient { put("v2.updateIncident", false); put("v2.updateIncidentAttachments", false); put("v2.updateIncidentIntegration", false); + put("v2.updateIncidentNotificationTemplate", false); put("v2.updateIncidentTodo", false); put("v2.updateIncidentType", false); put("v2.createAWSAccount", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java index 131b946ac2d..e2c515fef0b 100644 --- a/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/IncidentsApi.java @@ -5,6 +5,7 @@ import com.datadog.api.client.ApiResponse; import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.CreateIncidentNotificationTemplateRequest; import com.datadog.api.client.v2.model.IncidentAttachmentAttachmentType; import com.datadog.api.client.v2.model.IncidentAttachmentRelatedObject; import com.datadog.api.client.v2.model.IncidentAttachmentUpdateRequest; @@ -15,6 +16,8 @@ import com.datadog.api.client.v2.model.IncidentIntegrationMetadataListResponse; import com.datadog.api.client.v2.model.IncidentIntegrationMetadataPatchRequest; import com.datadog.api.client.v2.model.IncidentIntegrationMetadataResponse; +import com.datadog.api.client.v2.model.IncidentNotificationTemplate; +import com.datadog.api.client.v2.model.IncidentNotificationTemplateArray; import com.datadog.api.client.v2.model.IncidentRelatedObject; import com.datadog.api.client.v2.model.IncidentResponse; import com.datadog.api.client.v2.model.IncidentResponseData; @@ -31,6 +34,7 @@ import com.datadog.api.client.v2.model.IncidentTypeResponse; import com.datadog.api.client.v2.model.IncidentUpdateRequest; import com.datadog.api.client.v2.model.IncidentsResponse; +import com.datadog.api.client.v2.model.PatchIncidentNotificationTemplateRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -38,6 +42,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.concurrent.CompletableFuture; @jakarta.annotation.Generated( @@ -406,6 +411,165 @@ public ApiResponse createIncidentIntegratio new GenericType() {}); } + /** + * Create incident notification template. + * + *

See {@link #createIncidentNotificationTemplateWithHttpInfo}. + * + * @param body (required) + * @return IncidentNotificationTemplate + * @throws ApiException if fails to make API call + */ + public IncidentNotificationTemplate createIncidentNotificationTemplate( + CreateIncidentNotificationTemplateRequest body) throws ApiException { + return createIncidentNotificationTemplateWithHttpInfo(body).getData(); + } + + /** + * Create incident notification template. + * + *

See {@link #createIncidentNotificationTemplateWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<IncidentNotificationTemplate> + */ + public CompletableFuture createIncidentNotificationTemplateAsync( + CreateIncidentNotificationTemplateRequest body) { + return createIncidentNotificationTemplateWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Creates a new notification template. + * + * @param body (required) + * @return ApiResponse<IncidentNotificationTemplate> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createIncidentNotificationTemplateWithHttpInfo( + CreateIncidentNotificationTemplateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createIncidentNotificationTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createIncidentNotificationTemplate"); + } + // create path and map variables + String localVarPath = "/api/v2/incidents/config/notification-templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentNotificationTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create incident notification template. + * + *

See {@link #createIncidentNotificationTemplateWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<IncidentNotificationTemplate>> + */ + public CompletableFuture> + createIncidentNotificationTemplateWithHttpInfoAsync( + CreateIncidentNotificationTemplateRequest body) { + // Check if unstable operation is enabled + String operationId = "createIncidentNotificationTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " createIncidentNotificationTemplate")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/incidents/config/notification-templates"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.createIncidentNotificationTemplate", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create an incident todo. * @@ -1077,30 +1241,48 @@ public CompletableFuture> deleteIncidentIntegrationWithHttpInf null); } + /** Manage optional parameters to deleteIncidentNotificationTemplate. */ + public static class DeleteIncidentNotificationTemplateOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of relationships to include. Supported values: + * created_by_user, last_modified_by_user, incident_type + * (optional) + * @return DeleteIncidentNotificationTemplateOptionalParameters + */ + public DeleteIncidentNotificationTemplateOptionalParameters include(String include) { + this.include = include; + return this; + } + } + /** - * Delete an incident todo. + * Delete a notification template. * - *

See {@link #deleteIncidentTodoWithHttpInfo}. + *

See {@link #deleteIncidentNotificationTemplateWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @param todoId The UUID of the incident todo. (required) + * @param id The ID of the notification template. (required) * @throws ApiException if fails to make API call */ - public void deleteIncidentTodo(String incidentId, String todoId) throws ApiException { - deleteIncidentTodoWithHttpInfo(incidentId, todoId); + public void deleteIncidentNotificationTemplate(UUID id) throws ApiException { + deleteIncidentNotificationTemplateWithHttpInfo( + id, new DeleteIncidentNotificationTemplateOptionalParameters()); } /** - * Delete an incident todo. + * Delete a notification template. * - *

See {@link #deleteIncidentTodoWithHttpInfoAsync}. + *

See {@link #deleteIncidentNotificationTemplateWithHttpInfoAsync}. * - * @param incidentId The UUID of the incident. (required) - * @param todoId The UUID of the incident todo. (required) + * @param id The ID of the notification template. (required) * @return CompletableFuture */ - public CompletableFuture deleteIncidentTodoAsync(String incidentId, String todoId) { - return deleteIncidentTodoWithHttpInfoAsync(incidentId, todoId) + public CompletableFuture deleteIncidentNotificationTemplateAsync(UUID id) { + return deleteIncidentNotificationTemplateWithHttpInfoAsync( + id, new DeleteIncidentNotificationTemplateOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -1108,17 +1290,50 @@ public CompletableFuture deleteIncidentTodoAsync(String incidentId, String } /** - * Delete an incident todo. + * Delete a notification template. * - * @param incidentId The UUID of the incident. (required) - * @param todoId The UUID of the incident todo. (required) + *

See {@link #deleteIncidentNotificationTemplateWithHttpInfo}. + * + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. + * @throws ApiException if fails to make API call + */ + public void deleteIncidentNotificationTemplate( + UUID id, DeleteIncidentNotificationTemplateOptionalParameters parameters) + throws ApiException { + deleteIncidentNotificationTemplateWithHttpInfo(id, parameters); + } + + /** + * Delete a notification template. + * + *

See {@link #deleteIncidentNotificationTemplateWithHttpInfoAsync}. + * + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture + */ + public CompletableFuture deleteIncidentNotificationTemplateAsync( + UUID id, DeleteIncidentNotificationTemplateOptionalParameters parameters) { + return deleteIncidentNotificationTemplateWithHttpInfoAsync(id, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Deletes a notification template by its ID. + * + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -1126,10 +1341,11 @@ public CompletableFuture deleteIncidentTodoAsync(String incidentId, String * *
Response details
Status Code Description Response Headers
204 OK -
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse deleteIncidentTodoWithHttpInfo(String incidentId, String todoId) + public ApiResponse deleteIncidentNotificationTemplateWithHttpInfo( + UUID id, DeleteIncidentNotificationTemplateOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteIncidentTodo"; + String operationId = "deleteIncidentNotificationTemplate"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -1137,31 +1353,28 @@ public ApiResponse deleteIncidentTodoWithHttpInfo(String incidentId, Strin } Object localVarPostBody = null; - // verify the required parameter 'incidentId' is set - if (incidentId == null) { - throw new ApiException( - 400, "Missing the required parameter 'incidentId' when calling deleteIncidentTodo"); - } - - // verify the required parameter 'todoId' is set - if (todoId == null) { + // verify the required parameter 'id' is set + if (id == null) { throw new ApiException( - 400, "Missing the required parameter 'todoId' when calling deleteIncidentTodo"); + 400, + "Missing the required parameter 'id' when calling deleteIncidentNotificationTemplate"); } + String include = parameters.include; // create path and map variables String localVarPath = - "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) - .replaceAll("\\{" + "todo_id" + "\\}", apiClient.escapeString(todoId.toString())); + "/api/v2/incidents/config/notification-templates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.deleteIncidentTodo", + "v2.IncidentsApi.deleteIncidentNotificationTemplate", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"*/*"}, @@ -1178,18 +1391,18 @@ public ApiResponse deleteIncidentTodoWithHttpInfo(String incidentId, Strin } /** - * Delete an incident todo. + * Delete a notification template. * - *

See {@link #deleteIncidentTodoWithHttpInfo}. + *

See {@link #deleteIncidentNotificationTemplateWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @param todoId The UUID of the incident todo. (required) + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteIncidentTodoWithHttpInfoAsync( - String incidentId, String todoId) { + public CompletableFuture> deleteIncidentNotificationTemplateWithHttpInfoAsync( + UUID id, DeleteIncidentNotificationTemplateOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "deleteIncidentTodo"; + String operationId = "deleteIncidentNotificationTemplate"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -1200,39 +1413,34 @@ public CompletableFuture> deleteIncidentTodoWithHttpInfoAsync( } Object localVarPostBody = null; - // verify the required parameter 'incidentId' is set - if (incidentId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'incidentId' when calling deleteIncidentTodo")); - return result; - } - - // verify the required parameter 'todoId' is set - if (todoId == null) { + // verify the required parameter 'id' is set + if (id == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'todoId' when calling deleteIncidentTodo")); + 400, + "Missing the required parameter 'id' when calling" + + " deleteIncidentNotificationTemplate")); return result; } + String include = parameters.include; // create path and map variables String localVarPath = - "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) - .replaceAll("\\{" + "todo_id" + "\\}", apiClient.escapeString(todoId.toString())); + "/api/v2/incidents/config/notification-templates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.IncidentsApi.deleteIncidentTodo", + "v2.IncidentsApi.deleteIncidentNotificationTemplate", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"*/*"}, @@ -1254,27 +1462,29 @@ public CompletableFuture> deleteIncidentTodoWithHttpInfoAsync( } /** - * Delete an incident type. + * Delete an incident todo. * - *

See {@link #deleteIncidentTypeWithHttpInfo}. + *

See {@link #deleteIncidentTodoWithHttpInfo}. * - * @param incidentTypeId The UUID of the incident type. (required) + * @param incidentId The UUID of the incident. (required) + * @param todoId The UUID of the incident todo. (required) * @throws ApiException if fails to make API call */ - public void deleteIncidentType(String incidentTypeId) throws ApiException { - deleteIncidentTypeWithHttpInfo(incidentTypeId); + public void deleteIncidentTodo(String incidentId, String todoId) throws ApiException { + deleteIncidentTodoWithHttpInfo(incidentId, todoId); } /** - * Delete an incident type. + * Delete an incident todo. * - *

See {@link #deleteIncidentTypeWithHttpInfoAsync}. + *

See {@link #deleteIncidentTodoWithHttpInfoAsync}. * - * @param incidentTypeId The UUID of the incident type. (required) + * @param incidentId The UUID of the incident. (required) + * @param todoId The UUID of the incident todo. (required) * @return CompletableFuture */ - public CompletableFuture deleteIncidentTypeAsync(String incidentTypeId) { - return deleteIncidentTypeWithHttpInfoAsync(incidentTypeId) + public CompletableFuture deleteIncidentTodoAsync(String incidentId, String todoId) { + return deleteIncidentTodoWithHttpInfoAsync(incidentId, todoId) .thenApply( response -> { return response.getData(); @@ -1282,9 +1492,10 @@ public CompletableFuture deleteIncidentTypeAsync(String incidentTypeId) { } /** - * Delete an incident type. + * Delete an incident todo. * - * @param incidentTypeId The UUID of the incident type. (required) + * @param incidentId The UUID of the incident. (required) + * @param todoId The UUID of the incident todo. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -1299,10 +1510,10 @@ public CompletableFuture deleteIncidentTypeAsync(String incidentTypeId) { * 429 Too many requests - * */ - public ApiResponse deleteIncidentTypeWithHttpInfo(String incidentTypeId) + public ApiResponse deleteIncidentTodoWithHttpInfo(String incidentId, String todoId) throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteIncidentType"; + String operationId = "deleteIncidentTodo"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -1310,10 +1521,183 @@ public ApiResponse deleteIncidentTypeWithHttpInfo(String incidentTypeId) } Object localVarPostBody = null; - // verify the required parameter 'incidentTypeId' is set - if (incidentTypeId == null) { + // verify the required parameter 'incidentId' is set + if (incidentId == null) { throw new ApiException( - 400, "Missing the required parameter 'incidentTypeId' when calling deleteIncidentType"); + 400, "Missing the required parameter 'incidentId' when calling deleteIncidentTodo"); + } + + // verify the required parameter 'todoId' is set + if (todoId == null) { + throw new ApiException( + 400, "Missing the required parameter 'todoId' when calling deleteIncidentTodo"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll("\\{" + "todo_id" + "\\}", apiClient.escapeString(todoId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.deleteIncidentTodo", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete an incident todo. + * + *

See {@link #deleteIncidentTodoWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param todoId The UUID of the incident todo. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteIncidentTodoWithHttpInfoAsync( + String incidentId, String todoId) { + // Check if unstable operation is enabled + String operationId = "deleteIncidentTodo"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'incidentId' when calling deleteIncidentTodo")); + return result; + } + + // verify the required parameter 'todoId' is set + if (todoId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'todoId' when calling deleteIncidentTodo")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll("\\{" + "todo_id" + "\\}", apiClient.escapeString(todoId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.deleteIncidentTodo", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete an incident type. + * + *

See {@link #deleteIncidentTypeWithHttpInfo}. + * + * @param incidentTypeId The UUID of the incident type. (required) + * @throws ApiException if fails to make API call + */ + public void deleteIncidentType(String incidentTypeId) throws ApiException { + deleteIncidentTypeWithHttpInfo(incidentTypeId); + } + + /** + * Delete an incident type. + * + *

See {@link #deleteIncidentTypeWithHttpInfoAsync}. + * + * @param incidentTypeId The UUID of the incident type. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteIncidentTypeAsync(String incidentTypeId) { + return deleteIncidentTypeWithHttpInfoAsync(incidentTypeId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete an incident type. + * + * @param incidentTypeId The UUID of the incident type. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteIncidentTypeWithHttpInfo(String incidentTypeId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteIncidentType"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'incidentTypeId' is set + if (incidentTypeId == null) { + throw new ApiException( + 400, "Missing the required parameter 'incidentTypeId' when calling deleteIncidentType"); } // create path and map variables String localVarPath = @@ -1679,10 +2063,253 @@ public CompletableFuture getIncidentIntegra * 429 Too many requests - * */ - public ApiResponse getIncidentIntegrationWithHttpInfo( - String incidentId, String integrationMetadataId) throws ApiException { + public ApiResponse getIncidentIntegrationWithHttpInfo( + String incidentId, String integrationMetadataId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getIncidentIntegration"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + throw new ApiException( + 400, "Missing the required parameter 'incidentId' when calling getIncidentIntegration"); + } + + // verify the required parameter 'integrationMetadataId' is set + if (integrationMetadataId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'integrationMetadataId' when calling" + + " getIncidentIntegration"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll( + "\\{" + "integration_metadata_id" + "\\}", + apiClient.escapeString(integrationMetadataId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.getIncidentIntegration", + 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 incident integration metadata details. + * + *

See {@link #getIncidentIntegrationWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @param integrationMetadataId The UUID of the incident integration metadata. (required) + * @return CompletableFuture<ApiResponse<IncidentIntegrationMetadataResponse>> + */ + public CompletableFuture> + getIncidentIntegrationWithHttpInfoAsync(String incidentId, String integrationMetadataId) { + // Check if unstable operation is enabled + String operationId = "getIncidentIntegration"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'incidentId' when calling getIncidentIntegration")); + return result; + } + + // verify the required parameter 'integrationMetadataId' is set + if (integrationMetadataId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'integrationMetadataId' when calling" + + " getIncidentIntegration")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) + .replaceAll( + "\\{" + "integration_metadata_id" + "\\}", + apiClient.escapeString(integrationMetadataId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.getIncidentIntegration", + 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 getIncidentNotificationTemplate. */ + public static class GetIncidentNotificationTemplateOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of relationships to include. Supported values: + * created_by_user, last_modified_by_user, incident_type + * (optional) + * @return GetIncidentNotificationTemplateOptionalParameters + */ + public GetIncidentNotificationTemplateOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Get incident notification template. + * + *

See {@link #getIncidentNotificationTemplateWithHttpInfo}. + * + * @param id The ID of the notification template. (required) + * @return IncidentNotificationTemplate + * @throws ApiException if fails to make API call + */ + public IncidentNotificationTemplate getIncidentNotificationTemplate(UUID id) throws ApiException { + return getIncidentNotificationTemplateWithHttpInfo( + id, new GetIncidentNotificationTemplateOptionalParameters()) + .getData(); + } + + /** + * Get incident notification template. + * + *

See {@link #getIncidentNotificationTemplateWithHttpInfoAsync}. + * + * @param id The ID of the notification template. (required) + * @return CompletableFuture<IncidentNotificationTemplate> + */ + public CompletableFuture getIncidentNotificationTemplateAsync( + UUID id) { + return getIncidentNotificationTemplateWithHttpInfoAsync( + id, new GetIncidentNotificationTemplateOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get incident notification template. + * + *

See {@link #getIncidentNotificationTemplateWithHttpInfo}. + * + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. + * @return IncidentNotificationTemplate + * @throws ApiException if fails to make API call + */ + public IncidentNotificationTemplate getIncidentNotificationTemplate( + UUID id, GetIncidentNotificationTemplateOptionalParameters parameters) throws ApiException { + return getIncidentNotificationTemplateWithHttpInfo(id, parameters).getData(); + } + + /** + * Get incident notification template. + * + *

See {@link #getIncidentNotificationTemplateWithHttpInfoAsync}. + * + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentNotificationTemplate> + */ + public CompletableFuture getIncidentNotificationTemplateAsync( + UUID id, GetIncidentNotificationTemplateOptionalParameters parameters) { + return getIncidentNotificationTemplateWithHttpInfoAsync(id, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieves a specific notification template by its ID. + * + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentNotificationTemplate> + * @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 getIncidentNotificationTemplateWithHttpInfo( + UUID id, GetIncidentNotificationTemplateOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "getIncidentIntegration"; + String operationId = "getIncidentNotificationTemplate"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -1690,35 +2317,27 @@ public ApiResponse getIncidentIntegrationWi } Object localVarPostBody = null; - // verify the required parameter 'incidentId' is set - if (incidentId == null) { - throw new ApiException( - 400, "Missing the required parameter 'incidentId' when calling getIncidentIntegration"); - } - - // verify the required parameter 'integrationMetadataId' is set - if (integrationMetadataId == null) { + // verify the required parameter 'id' is set + if (id == null) { throw new ApiException( - 400, - "Missing the required parameter 'integrationMetadataId' when calling" - + " getIncidentIntegration"); + 400, "Missing the required parameter 'id' when calling getIncidentNotificationTemplate"); } + String include = parameters.include; // create path and map variables String localVarPath = - "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) - .replaceAll( - "\\{" + "integration_metadata_id" + "\\}", - apiClient.escapeString(integrationMetadataId.toString())); + "/api/v2/incidents/config/notification-templates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.getIncidentIntegration", + "v2.IncidentsApi.getIncidentNotificationTemplate", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -1731,26 +2350,27 @@ public ApiResponse getIncidentIntegrationWi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get incident integration metadata details. + * Get incident notification template. * - *

See {@link #getIncidentIntegrationWithHttpInfo}. + *

See {@link #getIncidentNotificationTemplateWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @param integrationMetadataId The UUID of the incident integration metadata. (required) - * @return CompletableFuture<ApiResponse<IncidentIntegrationMetadataResponse>> + * @param id The ID of the notification template. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentNotificationTemplate>> */ - public CompletableFuture> - getIncidentIntegrationWithHttpInfoAsync(String incidentId, String integrationMetadataId) { + public CompletableFuture> + getIncidentNotificationTemplateWithHttpInfoAsync( + UUID id, GetIncidentNotificationTemplateOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "getIncidentIntegration"; + String operationId = "getIncidentNotificationTemplate"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); @@ -1758,52 +2378,40 @@ public ApiResponse getIncidentIntegrationWi } Object localVarPostBody = null; - // verify the required parameter 'incidentId' is set - if (incidentId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'incidentId' when calling getIncidentIntegration")); - return result; - } - - // verify the required parameter 'integrationMetadataId' is set - if (integrationMetadataId == null) { - CompletableFuture> result = + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'integrationMetadataId' when calling" - + " getIncidentIntegration")); + "Missing the required parameter 'id' when calling getIncidentNotificationTemplate")); return result; } + String include = parameters.include; // create path and map variables String localVarPath = - "/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())) - .replaceAll( - "\\{" + "integration_metadata_id" + "\\}", - apiClient.escapeString(integrationMetadataId.toString())); + "/api/v2/incidents/config/notification-templates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.IncidentsApi.getIncidentIntegration", + "v2.IncidentsApi.getIncidentNotificationTemplate", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -1816,7 +2424,7 @@ public ApiResponse getIncidentIntegrationWi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -2404,30 +3012,255 @@ public ApiResponse listIncidentAttachmentsWithHttpI } /** - * Get a list of an incident's integration metadata. + * Get a list of an incident's integration metadata. + * + *

See {@link #listIncidentIntegrationsWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @return IncidentIntegrationMetadataListResponse + * @throws ApiException if fails to make API call + */ + public IncidentIntegrationMetadataListResponse listIncidentIntegrations(String incidentId) + throws ApiException { + return listIncidentIntegrationsWithHttpInfo(incidentId).getData(); + } + + /** + * Get a list of an incident's integration metadata. + * + *

See {@link #listIncidentIntegrationsWithHttpInfoAsync}. + * + * @param incidentId The UUID of the incident. (required) + * @return CompletableFuture<IncidentIntegrationMetadataListResponse> + */ + public CompletableFuture listIncidentIntegrationsAsync( + String incidentId) { + return listIncidentIntegrationsWithHttpInfoAsync(incidentId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all integration metadata for an incident. + * + * @param incidentId The UUID of the incident. (required) + * @return ApiResponse<IncidentIntegrationMetadataListResponse> + * @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 listIncidentIntegrationsWithHttpInfo( + String incidentId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listIncidentIntegrations"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + throw new ApiException( + 400, "Missing the required parameter 'incidentId' when calling listIncidentIntegrations"); + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidentIntegrations", + 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 a list of an incident's integration metadata. + * + *

See {@link #listIncidentIntegrationsWithHttpInfo}. + * + * @param incidentId The UUID of the incident. (required) + * @return CompletableFuture<ApiResponse<IncidentIntegrationMetadataListResponse>> + */ + public CompletableFuture> + listIncidentIntegrationsWithHttpInfoAsync(String incidentId) { + // Check if unstable operation is enabled + String operationId = "listIncidentIntegrations"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'incidentId' is set + if (incidentId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'incidentId' when calling listIncidentIntegrations")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/incidents/{incident_id}/relationships/integrations" + .replaceAll( + "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.listIncidentIntegrations", + 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 listIncidentNotificationTemplates. */ + public static class ListIncidentNotificationTemplatesOptionalParameters { + private UUID filterIncidentType; + private String include; + + /** + * Set filterIncidentType. + * + * @param filterIncidentType Optional incident type ID filter. (optional) + * @return ListIncidentNotificationTemplatesOptionalParameters + */ + public ListIncidentNotificationTemplatesOptionalParameters filterIncidentType( + UUID filterIncidentType) { + this.filterIncidentType = filterIncidentType; + return this; + } + + /** + * Set include. + * + * @param include Comma-separated list of relationships to include. Supported values: + * created_by_user, last_modified_by_user, incident_type + * (optional) + * @return ListIncidentNotificationTemplatesOptionalParameters + */ + public ListIncidentNotificationTemplatesOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * List incident notification templates. + * + *

See {@link #listIncidentNotificationTemplatesWithHttpInfo}. + * + * @return IncidentNotificationTemplateArray + * @throws ApiException if fails to make API call + */ + public IncidentNotificationTemplateArray listIncidentNotificationTemplates() throws ApiException { + return listIncidentNotificationTemplatesWithHttpInfo( + new ListIncidentNotificationTemplatesOptionalParameters()) + .getData(); + } + + /** + * List incident notification templates. + * + *

See {@link #listIncidentNotificationTemplatesWithHttpInfoAsync}. + * + * @return CompletableFuture<IncidentNotificationTemplateArray> + */ + public CompletableFuture + listIncidentNotificationTemplatesAsync() { + return listIncidentNotificationTemplatesWithHttpInfoAsync( + new ListIncidentNotificationTemplatesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List incident notification templates. * - *

See {@link #listIncidentIntegrationsWithHttpInfo}. + *

See {@link #listIncidentNotificationTemplatesWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @return IncidentIntegrationMetadataListResponse + * @param parameters Optional parameters for the request. + * @return IncidentNotificationTemplateArray * @throws ApiException if fails to make API call */ - public IncidentIntegrationMetadataListResponse listIncidentIntegrations(String incidentId) - throws ApiException { - return listIncidentIntegrationsWithHttpInfo(incidentId).getData(); + public IncidentNotificationTemplateArray listIncidentNotificationTemplates( + ListIncidentNotificationTemplatesOptionalParameters parameters) throws ApiException { + return listIncidentNotificationTemplatesWithHttpInfo(parameters).getData(); } /** - * Get a list of an incident's integration metadata. + * List incident notification templates. * - *

See {@link #listIncidentIntegrationsWithHttpInfoAsync}. + *

See {@link #listIncidentNotificationTemplatesWithHttpInfoAsync}. * - * @param incidentId The UUID of the incident. (required) - * @return CompletableFuture<IncidentIntegrationMetadataListResponse> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentNotificationTemplateArray> */ - public CompletableFuture listIncidentIntegrationsAsync( - String incidentId) { - return listIncidentIntegrationsWithHttpInfoAsync(incidentId) + public CompletableFuture + listIncidentNotificationTemplatesAsync( + ListIncidentNotificationTemplatesOptionalParameters parameters) { + return listIncidentNotificationTemplatesWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -2435,10 +3268,10 @@ public CompletableFuture listIncidentIn } /** - * Get all integration metadata for an incident. + * Lists all notification templates. Optionally filter by incident type. * - * @param incidentId The UUID of the incident. (required) - * @return ApiResponse<IncidentIntegrationMetadataListResponse> + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentNotificationTemplateArray> * @throws ApiException if fails to make API call * @http.response.details * @@ -2452,35 +3285,34 @@ public CompletableFuture listIncidentIn * *
429 Too many requests -
*/ - public ApiResponse listIncidentIntegrationsWithHttpInfo( - String incidentId) throws ApiException { + public ApiResponse + listIncidentNotificationTemplatesWithHttpInfo( + ListIncidentNotificationTemplatesOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "listIncidentIntegrations"; + String operationId = "listIncidentNotificationTemplates"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } Object localVarPostBody = null; - - // verify the required parameter 'incidentId' is set - if (incidentId == null) { - throw new ApiException( - 400, "Missing the required parameter 'incidentId' when calling listIncidentIntegrations"); - } + UUID filterIncidentType = parameters.filterIncidentType; + String include = parameters.include; // create path and map variables - String localVarPath = - "/api/v2/incidents/{incident_id}/relationships/integrations" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + String localVarPath = "/api/v2/incidents/config/notification-templates"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[incident-type]", filterIncidentType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.IncidentsApi.listIncidentIntegrations", + "v2.IncidentsApi.listIncidentNotificationTemplates", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -2493,63 +3325,57 @@ public ApiResponse listIncidentIntegrat localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a list of an incident's integration metadata. + * List incident notification templates. * - *

See {@link #listIncidentIntegrationsWithHttpInfo}. + *

See {@link #listIncidentNotificationTemplatesWithHttpInfo}. * - * @param incidentId The UUID of the incident. (required) - * @return CompletableFuture<ApiResponse<IncidentIntegrationMetadataListResponse>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentNotificationTemplateArray>> */ - public CompletableFuture> - listIncidentIntegrationsWithHttpInfoAsync(String incidentId) { + public CompletableFuture> + listIncidentNotificationTemplatesWithHttpInfoAsync( + ListIncidentNotificationTemplatesOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "listIncidentIntegrations"; + String operationId = "listIncidentNotificationTemplates"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - - // verify the required parameter 'incidentId' is set - if (incidentId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'incidentId' when calling listIncidentIntegrations")); - return result; - } + UUID filterIncidentType = parameters.filterIncidentType; + String include = parameters.include; // create path and map variables - String localVarPath = - "/api/v2/incidents/{incident_id}/relationships/integrations" - .replaceAll( - "\\{" + "incident_id" + "\\}", apiClient.escapeString(incidentId.toString())); + String localVarPath = "/api/v2/incidents/config/notification-templates"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[incident-type]", filterIncidentType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.IncidentsApi.listIncidentIntegrations", + "v2.IncidentsApi.listIncidentNotificationTemplates", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -2562,7 +3388,7 @@ public ApiResponse listIncidentIntegrat localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** Manage optional parameters to listIncidents. */ @@ -4251,6 +5077,268 @@ public ApiResponse updateIncidentIntegratio new GenericType() {}); } + /** Manage optional parameters to updateIncidentNotificationTemplate. */ + public static class UpdateIncidentNotificationTemplateOptionalParameters { + private String include; + + /** + * Set include. + * + * @param include Comma-separated list of relationships to include. Supported values: + * created_by_user, last_modified_by_user, incident_type + * (optional) + * @return UpdateIncidentNotificationTemplateOptionalParameters + */ + public UpdateIncidentNotificationTemplateOptionalParameters include(String include) { + this.include = include; + return this; + } + } + + /** + * Update incident notification template. + * + *

See {@link #updateIncidentNotificationTemplateWithHttpInfo}. + * + * @param id The ID of the notification template. (required) + * @param body (required) + * @return IncidentNotificationTemplate + * @throws ApiException if fails to make API call + */ + public IncidentNotificationTemplate updateIncidentNotificationTemplate( + UUID id, PatchIncidentNotificationTemplateRequest body) throws ApiException { + return updateIncidentNotificationTemplateWithHttpInfo( + id, body, new UpdateIncidentNotificationTemplateOptionalParameters()) + .getData(); + } + + /** + * Update incident notification template. + * + *

See {@link #updateIncidentNotificationTemplateWithHttpInfoAsync}. + * + * @param id The ID of the notification template. (required) + * @param body (required) + * @return CompletableFuture<IncidentNotificationTemplate> + */ + public CompletableFuture updateIncidentNotificationTemplateAsync( + UUID id, PatchIncidentNotificationTemplateRequest body) { + return updateIncidentNotificationTemplateWithHttpInfoAsync( + id, body, new UpdateIncidentNotificationTemplateOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update incident notification template. + * + *

See {@link #updateIncidentNotificationTemplateWithHttpInfo}. + * + * @param id The ID of the notification template. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return IncidentNotificationTemplate + * @throws ApiException if fails to make API call + */ + public IncidentNotificationTemplate updateIncidentNotificationTemplate( + UUID id, + PatchIncidentNotificationTemplateRequest body, + UpdateIncidentNotificationTemplateOptionalParameters parameters) + throws ApiException { + return updateIncidentNotificationTemplateWithHttpInfo(id, body, parameters).getData(); + } + + /** + * Update incident notification template. + * + *

See {@link #updateIncidentNotificationTemplateWithHttpInfoAsync}. + * + * @param id The ID of the notification template. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IncidentNotificationTemplate> + */ + public CompletableFuture updateIncidentNotificationTemplateAsync( + UUID id, + PatchIncidentNotificationTemplateRequest body, + UpdateIncidentNotificationTemplateOptionalParameters parameters) { + return updateIncidentNotificationTemplateWithHttpInfoAsync(id, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Updates an existing notification template's attributes. + * + * @param id The ID of the notification template. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<IncidentNotificationTemplate> + * @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 updateIncidentNotificationTemplateWithHttpInfo( + UUID id, + PatchIncidentNotificationTemplateRequest body, + UpdateIncidentNotificationTemplateOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateIncidentNotificationTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, + "Missing the required parameter 'id' when calling updateIncidentNotificationTemplate"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling updateIncidentNotificationTemplate"); + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/notification-templates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentNotificationTemplate", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update incident notification template. + * + *

See {@link #updateIncidentNotificationTemplateWithHttpInfo}. + * + * @param id The ID of the notification template. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IncidentNotificationTemplate>> + */ + public CompletableFuture> + updateIncidentNotificationTemplateWithHttpInfoAsync( + UUID id, + PatchIncidentNotificationTemplateRequest body, + UpdateIncidentNotificationTemplateOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "updateIncidentNotificationTemplate"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'id' when calling" + + " updateIncidentNotificationTemplate")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " updateIncidentNotificationTemplate")); + return result; + } + String include = parameters.include; + // create path and map variables + String localVarPath = + "/api/v2/incidents/config/notification-templates/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.IncidentsApi.updateIncidentNotificationTemplate", + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update an incident todo. * diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateIncidentNotificationTemplateRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateIncidentNotificationTemplateRequest.java new file mode 100644 index 00000000000..0b6cb06a659 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateIncidentNotificationTemplateRequest.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.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; + +/** Create request for a notification template. */ +@JsonPropertyOrder({CreateIncidentNotificationTemplateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateIncidentNotificationTemplateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentNotificationTemplateCreateData data; + + public CreateIncidentNotificationTemplateRequest() {} + + @JsonCreator + public CreateIncidentNotificationTemplateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentNotificationTemplateCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CreateIncidentNotificationTemplateRequest data( + IncidentNotificationTemplateCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Notification template data for a create request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentNotificationTemplateCreateData getData() { + return data; + } + + public void setData(IncidentNotificationTemplateCreateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateIncidentNotificationTemplateRequest + */ + @JsonAnySetter + public CreateIncidentNotificationTemplateRequest 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 CreateIncidentNotificationTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateIncidentNotificationTemplateRequest createIncidentNotificationTemplateRequest = + (CreateIncidentNotificationTemplateRequest) o; + return Objects.equals(this.data, createIncidentNotificationTemplateRequest.data) + && Objects.equals( + this.additionalProperties, + createIncidentNotificationTemplateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateIncidentNotificationTemplateRequest {\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/GoogleMeetConfigurationReference.java b/src/main/java/com/datadog/api/client/v2/model/GoogleMeetConfigurationReference.java new file mode 100644 index 00000000000..9496305dc7f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleMeetConfigurationReference.java @@ -0,0 +1,153 @@ +/* + * 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 reference to a Google Meet Configuration resource. */ +@JsonPropertyOrder({GoogleMeetConfigurationReference.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleMeetConfigurationReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GoogleMeetConfigurationReferenceData data; + + public GoogleMeetConfigurationReference() {} + + @JsonCreator + public GoogleMeetConfigurationReference( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + GoogleMeetConfigurationReferenceData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public GoogleMeetConfigurationReference data(GoogleMeetConfigurationReferenceData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + return this; + } + + /** + * The Google Meet configuration relationship data object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GoogleMeetConfigurationReferenceData getData() { + return data; + } + + public void setData(GoogleMeetConfigurationReferenceData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GoogleMeetConfigurationReference + */ + @JsonAnySetter + public GoogleMeetConfigurationReference 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 GoogleMeetConfigurationReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleMeetConfigurationReference googleMeetConfigurationReference = + (GoogleMeetConfigurationReference) o; + return Objects.equals(this.data, googleMeetConfigurationReference.data) + && Objects.equals( + this.additionalProperties, googleMeetConfigurationReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleMeetConfigurationReference {\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/GoogleMeetConfigurationReferenceData.java b/src/main/java/com/datadog/api/client/v2/model/GoogleMeetConfigurationReferenceData.java new file mode 100644 index 00000000000..f47aabfa5a3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GoogleMeetConfigurationReferenceData.java @@ -0,0 +1,175 @@ +/* + * 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 Google Meet configuration relationship data object. */ +@JsonPropertyOrder({ + GoogleMeetConfigurationReferenceData.JSON_PROPERTY_ID, + GoogleMeetConfigurationReferenceData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GoogleMeetConfigurationReferenceData { + @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 GoogleMeetConfigurationReferenceData() {} + + @JsonCreator + public GoogleMeetConfigurationReferenceData( + @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 GoogleMeetConfigurationReferenceData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the Google Meet configuration. + * + * @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 GoogleMeetConfigurationReferenceData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the Google Meet configuration. + * + * @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 GoogleMeetConfigurationReferenceData + */ + @JsonAnySetter + public GoogleMeetConfigurationReferenceData 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 GoogleMeetConfigurationReferenceData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleMeetConfigurationReferenceData googleMeetConfigurationReferenceData = + (GoogleMeetConfigurationReferenceData) o; + return Objects.equals(this.id, googleMeetConfigurationReferenceData.id) + && Objects.equals(this.type, googleMeetConfigurationReferenceData.type) + && Objects.equals( + this.additionalProperties, googleMeetConfigurationReferenceData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleMeetConfigurationReferenceData {\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/IncidentNotificationTemplate.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplate.java new file mode 100644 index 00000000000..fcb06237ff4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplate.java @@ -0,0 +1,192 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response with a notification template. */ +@JsonPropertyOrder({ + IncidentNotificationTemplate.JSON_PROPERTY_DATA, + IncidentNotificationTemplate.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentNotificationTemplateResponseData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public IncidentNotificationTemplate() {} + + @JsonCreator + public IncidentNotificationTemplate( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentNotificationTemplateResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public IncidentNotificationTemplate data(IncidentNotificationTemplateResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Notification template data from a response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentNotificationTemplateResponseData getData() { + return data; + } + + public void setData(IncidentNotificationTemplateResponseData data) { + this.data = data; + } + + public IncidentNotificationTemplate included( + List included) { + this.included = included; + for (IncidentNotificationTemplateIncludedItems item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentNotificationTemplate addIncludedItem( + IncidentNotificationTemplateIncludedItems includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Related objects that are included in the response. + * + * @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; + } + + /** + * 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 IncidentNotificationTemplate + */ + @JsonAnySetter + public IncidentNotificationTemplate 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 IncidentNotificationTemplate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplate incidentNotificationTemplate = (IncidentNotificationTemplate) o; + return Objects.equals(this.data, incidentNotificationTemplate.data) + && Objects.equals(this.included, incidentNotificationTemplate.included) + && Objects.equals( + this.additionalProperties, incidentNotificationTemplate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplate {\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/IncidentNotificationTemplateArray.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArray.java new file mode 100644 index 00000000000..49229dff154 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArray.java @@ -0,0 +1,230 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response with notification templates. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateArray.JSON_PROPERTY_DATA, + IncidentNotificationTemplateArray.JSON_PROPERTY_INCLUDED, + IncidentNotificationTemplateArray.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateArray { + @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 IncidentNotificationTemplateArrayMeta meta; + + public IncidentNotificationTemplateArray() {} + + @JsonCreator + public IncidentNotificationTemplateArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public IncidentNotificationTemplateArray data( + List data) { + this.data = data; + for (IncidentNotificationTemplateResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentNotificationTemplateArray addDataItem( + IncidentNotificationTemplateResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The NotificationTemplateArray data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public IncidentNotificationTemplateArray included( + List included) { + this.included = included; + for (IncidentNotificationTemplateIncludedItems item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IncidentNotificationTemplateArray addIncludedItem( + IncidentNotificationTemplateIncludedItems includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Related objects that are included in the response. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + public IncidentNotificationTemplateArray meta(IncidentNotificationTemplateArrayMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Response metadata. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentNotificationTemplateArrayMeta getMeta() { + return meta; + } + + public void setMeta(IncidentNotificationTemplateArrayMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IncidentNotificationTemplateArray + */ + @JsonAnySetter + public IncidentNotificationTemplateArray 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 IncidentNotificationTemplateArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateArray incidentNotificationTemplateArray = + (IncidentNotificationTemplateArray) o; + return Objects.equals(this.data, incidentNotificationTemplateArray.data) + && Objects.equals(this.included, incidentNotificationTemplateArray.included) + && Objects.equals(this.meta, incidentNotificationTemplateArray.meta) + && Objects.equals( + this.additionalProperties, incidentNotificationTemplateArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateArray {\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/IncidentNotificationTemplateArrayMeta.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArrayMeta.java new file mode 100644 index 00000000000..57b53a7d1a2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArrayMeta.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; + +/** Response metadata. */ +@JsonPropertyOrder({IncidentNotificationTemplateArrayMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateArrayMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private IncidentNotificationTemplateArrayMetaPage page; + + public IncidentNotificationTemplateArrayMeta page( + IncidentNotificationTemplateArrayMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination metadata. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentNotificationTemplateArrayMetaPage getPage() { + return page; + } + + public void setPage(IncidentNotificationTemplateArrayMetaPage page) { + this.page = page; + } + + /** + * 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 IncidentNotificationTemplateArrayMeta + */ + @JsonAnySetter + public IncidentNotificationTemplateArrayMeta 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 IncidentNotificationTemplateArrayMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateArrayMeta incidentNotificationTemplateArrayMeta = + (IncidentNotificationTemplateArrayMeta) o; + return Objects.equals(this.page, incidentNotificationTemplateArrayMeta.page) + && Objects.equals( + this.additionalProperties, incidentNotificationTemplateArrayMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateArrayMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/IncidentNotificationTemplateArrayMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArrayMetaPage.java new file mode 100644 index 00000000000..b852f4e91ae --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateArrayMetaPage.java @@ -0,0 +1,168 @@ +/* + * 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; + +/** Pagination metadata. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateArrayMetaPage.JSON_PROPERTY_TOTAL_COUNT, + IncidentNotificationTemplateArrayMetaPage.JSON_PROPERTY_TOTAL_FILTERED_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateArrayMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTAL_COUNT = "total_count"; + private Long totalCount; + + public static final String JSON_PROPERTY_TOTAL_FILTERED_COUNT = "total_filtered_count"; + private Long totalFilteredCount; + + public IncidentNotificationTemplateArrayMetaPage totalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Total number of notification templates. + * + * @return totalCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + + public IncidentNotificationTemplateArrayMetaPage totalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + return this; + } + + /** + * Total number of notification templates matching the filter. + * + * @return totalFilteredCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalFilteredCount() { + return totalFilteredCount; + } + + public void setTotalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + /** + * 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 IncidentNotificationTemplateArrayMetaPage + */ + @JsonAnySetter + public IncidentNotificationTemplateArrayMetaPage 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 IncidentNotificationTemplateArrayMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateArrayMetaPage incidentNotificationTemplateArrayMetaPage = + (IncidentNotificationTemplateArrayMetaPage) o; + return Objects.equals(this.totalCount, incidentNotificationTemplateArrayMetaPage.totalCount) + && Objects.equals( + this.totalFilteredCount, incidentNotificationTemplateArrayMetaPage.totalFilteredCount) + && Objects.equals( + this.additionalProperties, + incidentNotificationTemplateArrayMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(totalCount, totalFilteredCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateArrayMetaPage {\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append(" totalFilteredCount: ").append(toIndentedString(totalFilteredCount)).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/IncidentNotificationTemplateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateAttributes.java new file mode 100644 index 00000000000..800ce824fa7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateAttributes.java @@ -0,0 +1,270 @@ +/* + * 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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The notification template's attributes. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateAttributes.JSON_PROPERTY_CATEGORY, + IncidentNotificationTemplateAttributes.JSON_PROPERTY_CONTENT, + IncidentNotificationTemplateAttributes.JSON_PROPERTY_CREATED, + IncidentNotificationTemplateAttributes.JSON_PROPERTY_MODIFIED, + IncidentNotificationTemplateAttributes.JSON_PROPERTY_NAME, + IncidentNotificationTemplateAttributes.JSON_PROPERTY_SUBJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_CREATED = "created"; + private OffsetDateTime created; + + public static final String JSON_PROPERTY_MODIFIED = "modified"; + private OffsetDateTime modified; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public IncidentNotificationTemplateAttributes() {} + + @JsonCreator + public IncidentNotificationTemplateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT) String content, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED) OffsetDateTime created, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED) OffsetDateTime modified, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_SUBJECT) String subject) { + this.category = category; + this.content = content; + this.created = created; + this.modified = modified; + this.name = name; + this.subject = subject; + } + + public IncidentNotificationTemplateAttributes category(String category) { + this.category = category; + return this; + } + + /** + * The category of the notification template. + * + * @return category + */ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public IncidentNotificationTemplateAttributes content(String content) { + this.content = content; + return this; + } + + /** + * The content body of the notification template. + * + * @return content + */ + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + /** + * Timestamp when the notification template was created. + * + * @return created + */ + @JsonProperty(JSON_PROPERTY_CREATED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreated() { + return created; + } + + /** + * Timestamp when the notification template was last modified. + * + * @return modified + */ + @JsonProperty(JSON_PROPERTY_MODIFIED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getModified() { + return modified; + } + + public IncidentNotificationTemplateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the notification template. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public IncidentNotificationTemplateAttributes subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject line of the notification template. + * + * @return subject + */ + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + /** + * 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 IncidentNotificationTemplateAttributes + */ + @JsonAnySetter + public IncidentNotificationTemplateAttributes 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 IncidentNotificationTemplateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateAttributes incidentNotificationTemplateAttributes = + (IncidentNotificationTemplateAttributes) o; + return Objects.equals(this.category, incidentNotificationTemplateAttributes.category) + && Objects.equals(this.content, incidentNotificationTemplateAttributes.content) + && Objects.equals(this.created, incidentNotificationTemplateAttributes.created) + && Objects.equals(this.modified, incidentNotificationTemplateAttributes.modified) + && Objects.equals(this.name, incidentNotificationTemplateAttributes.name) + && Objects.equals(this.subject, incidentNotificationTemplateAttributes.subject) + && Objects.equals( + this.additionalProperties, incidentNotificationTemplateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(category, content, created, modified, name, subject, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateAttributes {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).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/IncidentNotificationTemplateCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateAttributes.java new file mode 100644 index 00000000000..f23a1e7baad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateAttributes.java @@ -0,0 +1,233 @@ +/* + * 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 for creating a notification template. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateCreateAttributes.JSON_PROPERTY_CATEGORY, + IncidentNotificationTemplateCreateAttributes.JSON_PROPERTY_CONTENT, + IncidentNotificationTemplateCreateAttributes.JSON_PROPERTY_NAME, + IncidentNotificationTemplateCreateAttributes.JSON_PROPERTY_SUBJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public IncidentNotificationTemplateCreateAttributes() {} + + @JsonCreator + public IncidentNotificationTemplateCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) String category, + @JsonProperty(required = true, value = JSON_PROPERTY_CONTENT) String content, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_SUBJECT) String subject) { + this.category = category; + this.content = content; + this.name = name; + this.subject = subject; + } + + public IncidentNotificationTemplateCreateAttributes category(String category) { + this.category = category; + return this; + } + + /** + * The category of the notification template. + * + * @return category + */ + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public IncidentNotificationTemplateCreateAttributes content(String content) { + this.content = content; + return this; + } + + /** + * The content body of the notification template. + * + * @return content + */ + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public IncidentNotificationTemplateCreateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the notification template. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public IncidentNotificationTemplateCreateAttributes subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject line of the notification template. + * + * @return subject + */ + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + /** + * 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 IncidentNotificationTemplateCreateAttributes + */ + @JsonAnySetter + public IncidentNotificationTemplateCreateAttributes 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 IncidentNotificationTemplateCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateCreateAttributes incidentNotificationTemplateCreateAttributes = + (IncidentNotificationTemplateCreateAttributes) o; + return Objects.equals(this.category, incidentNotificationTemplateCreateAttributes.category) + && Objects.equals(this.content, incidentNotificationTemplateCreateAttributes.content) + && Objects.equals(this.name, incidentNotificationTemplateCreateAttributes.name) + && Objects.equals(this.subject, incidentNotificationTemplateCreateAttributes.subject) + && Objects.equals( + this.additionalProperties, + incidentNotificationTemplateCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(category, content, name, subject, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateCreateAttributes {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).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/IncidentNotificationTemplateCreateData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateData.java new file mode 100644 index 00000000000..5b061bf87fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateData.java @@ -0,0 +1,214 @@ +/* + * 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; + +/** Notification template data for a create request. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateCreateData.JSON_PROPERTY_ATTRIBUTES, + IncidentNotificationTemplateCreateData.JSON_PROPERTY_RELATIONSHIPS, + IncidentNotificationTemplateCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentNotificationTemplateCreateAttributes attributes; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IncidentNotificationTemplateCreateDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentNotificationTemplateType type; + + public IncidentNotificationTemplateCreateData() {} + + @JsonCreator + public IncidentNotificationTemplateCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + IncidentNotificationTemplateCreateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentNotificationTemplateType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentNotificationTemplateCreateData attributes( + IncidentNotificationTemplateCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes for creating a notification template. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentNotificationTemplateCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IncidentNotificationTemplateCreateAttributes attributes) { + this.attributes = attributes; + } + + public IncidentNotificationTemplateCreateData relationships( + IncidentNotificationTemplateCreateDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * The definition of NotificationTemplateCreateDataRelationships object. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentNotificationTemplateCreateDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IncidentNotificationTemplateCreateDataRelationships relationships) { + this.relationships = relationships; + } + + public IncidentNotificationTemplateCreateData type(IncidentNotificationTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notification templates resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentNotificationTemplateType getType() { + return type; + } + + public void setType(IncidentNotificationTemplateType 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 IncidentNotificationTemplateCreateData + */ + @JsonAnySetter + public IncidentNotificationTemplateCreateData 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 IncidentNotificationTemplateCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateCreateData incidentNotificationTemplateCreateData = + (IncidentNotificationTemplateCreateData) o; + return Objects.equals(this.attributes, incidentNotificationTemplateCreateData.attributes) + && Objects.equals(this.relationships, incidentNotificationTemplateCreateData.relationships) + && Objects.equals(this.type, incidentNotificationTemplateCreateData.type) + && Objects.equals( + this.additionalProperties, incidentNotificationTemplateCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/IncidentNotificationTemplateCreateDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateDataRelationships.java new file mode 100644 index 00000000000..16f9cd2e5e8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateCreateDataRelationships.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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 definition of NotificationTemplateCreateDataRelationships object. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateCreateDataRelationships.JSON_PROPERTY_INCIDENT_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateCreateDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private RelationshipToIncidentType incidentType; + + public IncidentNotificationTemplateCreateDataRelationships incidentType( + RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * Relationship to an incident type. + * + * @return incidentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToIncidentType getIncidentType() { + return incidentType; + } + + public void setIncidentType(RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + } + + /** + * 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 IncidentNotificationTemplateCreateDataRelationships + */ + @JsonAnySetter + public IncidentNotificationTemplateCreateDataRelationships 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 IncidentNotificationTemplateCreateDataRelationships object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateCreateDataRelationships + incidentNotificationTemplateCreateDataRelationships = + (IncidentNotificationTemplateCreateDataRelationships) o; + return Objects.equals( + this.incidentType, incidentNotificationTemplateCreateDataRelationships.incidentType) + && Objects.equals( + this.additionalProperties, + incidentNotificationTemplateCreateDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(incidentType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateCreateDataRelationships {\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).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/IncidentNotificationTemplateIncludedItems.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateIncludedItems.java new file mode 100644 index 00000000000..76d6d8a8fc4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateIncludedItems.java @@ -0,0 +1,287 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.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 = + IncidentNotificationTemplateIncludedItems + .IncidentNotificationTemplateIncludedItemsDeserializer.class) +@JsonSerialize( + using = + IncidentNotificationTemplateIncludedItems + .IncidentNotificationTemplateIncludedItemsSerializer.class) +public class IncidentNotificationTemplateIncludedItems extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(IncidentNotificationTemplateIncludedItems.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class IncidentNotificationTemplateIncludedItemsSerializer + extends StdSerializer { + public IncidentNotificationTemplateIncludedItemsSerializer( + Class t) { + super(t); + } + + public IncidentNotificationTemplateIncludedItemsSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentNotificationTemplateIncludedItems value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class IncidentNotificationTemplateIncludedItemsDeserializer + extends StdDeserializer { + public IncidentNotificationTemplateIncludedItemsDeserializer() { + this(IncidentNotificationTemplateIncludedItems.class); + } + + public IncidentNotificationTemplateIncludedItemsDeserializer(Class vc) { + super(vc); + } + + @Override + public IncidentNotificationTemplateIncludedItems 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 User + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (User.class.equals(Integer.class) + || User.class.equals(Long.class) + || User.class.equals(Float.class) + || User.class.equals(Double.class) + || User.class.equals(Boolean.class) + || User.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((User.class.equals(Integer.class) || User.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((User.class.equals(Float.class) || User.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (User.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (User.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(User.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 (!((User) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'User'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'User'", e); + } + + // deserialize IncidentTypeObject + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IncidentTypeObject.class.equals(Integer.class) + || IncidentTypeObject.class.equals(Long.class) + || IncidentTypeObject.class.equals(Float.class) + || IncidentTypeObject.class.equals(Double.class) + || IncidentTypeObject.class.equals(Boolean.class) + || IncidentTypeObject.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((IncidentTypeObject.class.equals(Integer.class) + || IncidentTypeObject.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IncidentTypeObject.class.equals(Float.class) + || IncidentTypeObject.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (IncidentTypeObject.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IncidentTypeObject.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(IncidentTypeObject.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 (!((IncidentTypeObject) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'IncidentTypeObject'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IncidentTypeObject'", e); + } + + IncidentNotificationTemplateIncludedItems ret = + new IncidentNotificationTemplateIncludedItems(); + 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 IncidentNotificationTemplateIncludedItems getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "IncidentNotificationTemplateIncludedItems cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public IncidentNotificationTemplateIncludedItems() { + super("oneOf", Boolean.FALSE); + } + + public IncidentNotificationTemplateIncludedItems(User o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public IncidentNotificationTemplateIncludedItems(IncidentTypeObject o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("User", new GenericType() {}); + schemas.put("IncidentTypeObject", new GenericType() {}); + JSON.registerDescendants( + IncidentNotificationTemplateIncludedItems.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return IncidentNotificationTemplateIncludedItems.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: User, IncidentTypeObject + * + *

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(User.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(IncidentTypeObject.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 User, IncidentTypeObject"); + } + + /** + * Get the actual instance, which can be the following: User, IncidentTypeObject + * + * @return The actual instance (User, IncidentTypeObject) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `User`. If the actual instance is not `User`, the ClassCastException + * will be thrown. + * + * @return The actual instance of `User` + * @throws ClassCastException if the instance is not `User` + */ + public User getUser() throws ClassCastException { + return (User) super.getActualInstance(); + } + + /** + * Get the actual instance of `IncidentTypeObject`. If the actual instance is not + * `IncidentTypeObject`, the ClassCastException will be thrown. + * + * @return The actual instance of `IncidentTypeObject` + * @throws ClassCastException if the instance is not `IncidentTypeObject` + */ + public IncidentTypeObject getIncidentTypeObject() throws ClassCastException { + return (IncidentTypeObject) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateRelationships.java new file mode 100644 index 00000000000..a4a4a3e8564 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateRelationships.java @@ -0,0 +1,201 @@ +/* + * 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 notification template's resource relationships. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateRelationships.JSON_PROPERTY_CREATED_BY_USER, + IncidentNotificationTemplateRelationships.JSON_PROPERTY_INCIDENT_TYPE, + IncidentNotificationTemplateRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY_USER = "created_by_user"; + private RelationshipToUser createdByUser; + + public static final String JSON_PROPERTY_INCIDENT_TYPE = "incident_type"; + private RelationshipToIncidentType incidentType; + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private RelationshipToUser lastModifiedByUser; + + public IncidentNotificationTemplateRelationships createdByUser(RelationshipToUser createdByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return createdByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUser getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(RelationshipToUser createdByUser) { + this.createdByUser = createdByUser; + } + + public IncidentNotificationTemplateRelationships incidentType( + RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + this.unparsed |= incidentType.unparsed; + return this; + } + + /** + * Relationship to an incident type. + * + * @return incidentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCIDENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToIncidentType getIncidentType() { + return incidentType; + } + + public void setIncidentType(RelationshipToIncidentType incidentType) { + this.incidentType = incidentType; + } + + public IncidentNotificationTemplateRelationships lastModifiedByUser( + RelationshipToUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return lastModifiedByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUser getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser(RelationshipToUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + } + + /** + * 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 IncidentNotificationTemplateRelationships + */ + @JsonAnySetter + public IncidentNotificationTemplateRelationships 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 IncidentNotificationTemplateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateRelationships incidentNotificationTemplateRelationships = + (IncidentNotificationTemplateRelationships) o; + return Objects.equals( + this.createdByUser, incidentNotificationTemplateRelationships.createdByUser) + && Objects.equals(this.incidentType, incidentNotificationTemplateRelationships.incidentType) + && Objects.equals( + this.lastModifiedByUser, incidentNotificationTemplateRelationships.lastModifiedByUser) + && Objects.equals( + this.additionalProperties, + incidentNotificationTemplateRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdByUser, incidentType, lastModifiedByUser, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateRelationships {\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" incidentType: ").append(toIndentedString(incidentType)).append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).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/IncidentNotificationTemplateResponseData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateResponseData.java new file mode 100644 index 00000000000..19fc2fab24f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateResponseData.java @@ -0,0 +1,242 @@ +/* + * 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; + +/** Notification template data from a response. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateResponseData.JSON_PROPERTY_ATTRIBUTES, + IncidentNotificationTemplateResponseData.JSON_PROPERTY_ID, + IncidentNotificationTemplateResponseData.JSON_PROPERTY_RELATIONSHIPS, + IncidentNotificationTemplateResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentNotificationTemplateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IncidentNotificationTemplateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentNotificationTemplateType type; + + public IncidentNotificationTemplateResponseData() {} + + @JsonCreator + public IncidentNotificationTemplateResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentNotificationTemplateType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentNotificationTemplateResponseData attributes( + IncidentNotificationTemplateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The notification template's attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentNotificationTemplateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IncidentNotificationTemplateAttributes attributes) { + this.attributes = attributes; + } + + public IncidentNotificationTemplateResponseData id(UUID id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the notification template. + * + * @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 IncidentNotificationTemplateResponseData relationships( + IncidentNotificationTemplateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * The notification template's resource relationships. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentNotificationTemplateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IncidentNotificationTemplateRelationships relationships) { + this.relationships = relationships; + } + + public IncidentNotificationTemplateResponseData type(IncidentNotificationTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notification templates resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentNotificationTemplateType getType() { + return type; + } + + public void setType(IncidentNotificationTemplateType 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 IncidentNotificationTemplateResponseData + */ + @JsonAnySetter + public IncidentNotificationTemplateResponseData 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 IncidentNotificationTemplateResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateResponseData incidentNotificationTemplateResponseData = + (IncidentNotificationTemplateResponseData) o; + return Objects.equals(this.attributes, incidentNotificationTemplateResponseData.attributes) + && Objects.equals(this.id, incidentNotificationTemplateResponseData.id) + && Objects.equals( + this.relationships, incidentNotificationTemplateResponseData.relationships) + && Objects.equals(this.type, incidentNotificationTemplateResponseData.type) + && Objects.equals( + this.additionalProperties, + incidentNotificationTemplateResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateResponseData {\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/IncidentNotificationTemplateType.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateType.java new file mode 100644 index 00000000000..693c044c07e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateType.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; + +/** Notification templates resource type. */ +@JsonSerialize( + using = IncidentNotificationTemplateType.IncidentNotificationTemplateTypeSerializer.class) +public class IncidentNotificationTemplateType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("notification_templates")); + + public static final IncidentNotificationTemplateType NOTIFICATION_TEMPLATES = + new IncidentNotificationTemplateType("notification_templates"); + + IncidentNotificationTemplateType(String value) { + super(value, allowedValues); + } + + public static class IncidentNotificationTemplateTypeSerializer + extends StdSerializer { + public IncidentNotificationTemplateTypeSerializer(Class t) { + super(t); + } + + public IncidentNotificationTemplateTypeSerializer() { + this(null); + } + + @Override + public void serialize( + IncidentNotificationTemplateType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IncidentNotificationTemplateType fromValue(String value) { + return new IncidentNotificationTemplateType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateUpdateAttributes.java new file mode 100644 index 00000000000..23c8a7d298f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateUpdateAttributes.java @@ -0,0 +1,222 @@ +/* + * 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 attributes to update on a notification template. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateUpdateAttributes.JSON_PROPERTY_CATEGORY, + IncidentNotificationTemplateUpdateAttributes.JSON_PROPERTY_CONTENT, + IncidentNotificationTemplateUpdateAttributes.JSON_PROPERTY_NAME, + IncidentNotificationTemplateUpdateAttributes.JSON_PROPERTY_SUBJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUBJECT = "subject"; + private String subject; + + public IncidentNotificationTemplateUpdateAttributes category(String category) { + this.category = category; + return this; + } + + /** + * The category of the notification template. + * + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public IncidentNotificationTemplateUpdateAttributes content(String content) { + this.content = content; + return this; + } + + /** + * The content body of the notification template. + * + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public IncidentNotificationTemplateUpdateAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the notification template. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public IncidentNotificationTemplateUpdateAttributes subject(String subject) { + this.subject = subject; + return this; + } + + /** + * The subject line of the notification template. + * + * @return subject + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + /** + * 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 IncidentNotificationTemplateUpdateAttributes + */ + @JsonAnySetter + public IncidentNotificationTemplateUpdateAttributes 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 IncidentNotificationTemplateUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateUpdateAttributes incidentNotificationTemplateUpdateAttributes = + (IncidentNotificationTemplateUpdateAttributes) o; + return Objects.equals(this.category, incidentNotificationTemplateUpdateAttributes.category) + && Objects.equals(this.content, incidentNotificationTemplateUpdateAttributes.content) + && Objects.equals(this.name, incidentNotificationTemplateUpdateAttributes.name) + && Objects.equals(this.subject, incidentNotificationTemplateUpdateAttributes.subject) + && Objects.equals( + this.additionalProperties, + incidentNotificationTemplateUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(category, content, name, subject, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateUpdateAttributes {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).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/IncidentNotificationTemplateUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateUpdateData.java new file mode 100644 index 00000000000..9710c6bf8a8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentNotificationTemplateUpdateData.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; +import java.util.UUID; + +/** Notification template data for an update request. */ +@JsonPropertyOrder({ + IncidentNotificationTemplateUpdateData.JSON_PROPERTY_ATTRIBUTES, + IncidentNotificationTemplateUpdateData.JSON_PROPERTY_ID, + IncidentNotificationTemplateUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentNotificationTemplateUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IncidentNotificationTemplateUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private IncidentNotificationTemplateType type; + + public IncidentNotificationTemplateUpdateData() {} + + @JsonCreator + public IncidentNotificationTemplateUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + IncidentNotificationTemplateType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public IncidentNotificationTemplateUpdateData attributes( + IncidentNotificationTemplateUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes to update on a notification template. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentNotificationTemplateUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IncidentNotificationTemplateUpdateAttributes attributes) { + this.attributes = attributes; + } + + public IncidentNotificationTemplateUpdateData id(UUID id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the notification template. + * + * @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 IncidentNotificationTemplateUpdateData type(IncidentNotificationTemplateType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Notification templates resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentNotificationTemplateType getType() { + return type; + } + + public void setType(IncidentNotificationTemplateType 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 IncidentNotificationTemplateUpdateData + */ + @JsonAnySetter + public IncidentNotificationTemplateUpdateData 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 IncidentNotificationTemplateUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentNotificationTemplateUpdateData incidentNotificationTemplateUpdateData = + (IncidentNotificationTemplateUpdateData) o; + return Objects.equals(this.attributes, incidentNotificationTemplateUpdateData.attributes) + && Objects.equals(this.id, incidentNotificationTemplateUpdateData.id) + && Objects.equals(this.type, incidentNotificationTemplateUpdateData.type) + && Objects.equals( + this.additionalProperties, incidentNotificationTemplateUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentNotificationTemplateUpdateData {\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/IncidentTypeObject.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTypeObject.java index 06252d5d7de..35506217230 100644 --- a/src/main/java/com/datadog/api/client/v2/model/IncidentTypeObject.java +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTypeObject.java @@ -21,6 +21,7 @@ @JsonPropertyOrder({ IncidentTypeObject.JSON_PROPERTY_ATTRIBUTES, IncidentTypeObject.JSON_PROPERTY_ID, + IncidentTypeObject.JSON_PROPERTY_RELATIONSHIPS, IncidentTypeObject.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( @@ -33,6 +34,9 @@ public class IncidentTypeObject { public static final String JSON_PROPERTY_ID = "id"; private String id; + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private IncidentTypeRelationships relationships; + public static final String JSON_PROPERTY_TYPE = "type"; private IncidentTypeType type = IncidentTypeType.INCIDENT_TYPES; @@ -89,6 +93,28 @@ public void setId(String id) { this.id = id; } + public IncidentTypeObject relationships(IncidentTypeRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * The incident type's resource relationships. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IncidentTypeRelationships getRelationships() { + return relationships; + } + + public void setRelationships(IncidentTypeRelationships relationships) { + this.relationships = relationships; + } + public IncidentTypeObject type(IncidentTypeType type) { this.type = type; this.unparsed |= !type.isValid(); @@ -171,13 +197,14 @@ public boolean equals(Object o) { IncidentTypeObject incidentTypeObject = (IncidentTypeObject) o; return Objects.equals(this.attributes, incidentTypeObject.attributes) && Objects.equals(this.id, incidentTypeObject.id) + && Objects.equals(this.relationships, incidentTypeObject.relationships) && Objects.equals(this.type, incidentTypeObject.type) && Objects.equals(this.additionalProperties, incidentTypeObject.additionalProperties); } @Override public int hashCode() { - return Objects.hash(attributes, id, type, additionalProperties); + return Objects.hash(attributes, id, relationships, type, additionalProperties); } @Override @@ -186,6 +213,7 @@ public String toString() { sb.append("class IncidentTypeObject {\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)) diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentTypeRelationships.java b/src/main/java/com/datadog/api/client/v2/model/IncidentTypeRelationships.java new file mode 100644 index 00000000000..28cb4409fcb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentTypeRelationships.java @@ -0,0 +1,306 @@ +/* + * 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 incident type's resource relationships. */ +@JsonPropertyOrder({ + IncidentTypeRelationships.JSON_PROPERTY_CREATED_BY_USER, + IncidentTypeRelationships.JSON_PROPERTY_GOOGLE_MEET_CONFIGURATION, + IncidentTypeRelationships.JSON_PROPERTY_LAST_MODIFIED_BY_USER, + IncidentTypeRelationships.JSON_PROPERTY_MICROSOFT_TEAMS_CONFIGURATION, + IncidentTypeRelationships.JSON_PROPERTY_ZOOM_CONFIGURATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IncidentTypeRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY_USER = "created_by_user"; + private RelationshipToUser createdByUser; + + public static final String JSON_PROPERTY_GOOGLE_MEET_CONFIGURATION = "google_meet_configuration"; + private JsonNullable googleMeetConfiguration = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LAST_MODIFIED_BY_USER = "last_modified_by_user"; + private RelationshipToUser lastModifiedByUser; + + public static final String JSON_PROPERTY_MICROSOFT_TEAMS_CONFIGURATION = + "microsoft_teams_configuration"; + private JsonNullable microsoftTeamsConfiguration = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ZOOM_CONFIGURATION = "zoom_configuration"; + private JsonNullable zoomConfiguration = + JsonNullable.undefined(); + + public IncidentTypeRelationships createdByUser(RelationshipToUser createdByUser) { + this.createdByUser = createdByUser; + this.unparsed |= createdByUser.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return createdByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUser getCreatedByUser() { + return createdByUser; + } + + public void setCreatedByUser(RelationshipToUser createdByUser) { + this.createdByUser = createdByUser; + } + + public IncidentTypeRelationships googleMeetConfiguration( + GoogleMeetConfigurationReference googleMeetConfiguration) { + this.googleMeetConfiguration = + JsonNullable.of(googleMeetConfiguration); + return this; + } + + /** + * A reference to a Google Meet Configuration resource. + * + * @return googleMeetConfiguration + */ + @jakarta.annotation.Nullable + @JsonIgnore + public GoogleMeetConfigurationReference getGoogleMeetConfiguration() { + return googleMeetConfiguration.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_GOOGLE_MEET_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getGoogleMeetConfiguration_JsonNullable() { + return googleMeetConfiguration; + } + + @JsonProperty(JSON_PROPERTY_GOOGLE_MEET_CONFIGURATION) + public void setGoogleMeetConfiguration_JsonNullable( + JsonNullable googleMeetConfiguration) { + this.googleMeetConfiguration = googleMeetConfiguration; + } + + public void setGoogleMeetConfiguration(GoogleMeetConfigurationReference googleMeetConfiguration) { + this.googleMeetConfiguration = + JsonNullable.of(googleMeetConfiguration); + } + + public IncidentTypeRelationships lastModifiedByUser(RelationshipToUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + this.unparsed |= lastModifiedByUser.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return lastModifiedByUser + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIED_BY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUser getLastModifiedByUser() { + return lastModifiedByUser; + } + + public void setLastModifiedByUser(RelationshipToUser lastModifiedByUser) { + this.lastModifiedByUser = lastModifiedByUser; + } + + public IncidentTypeRelationships microsoftTeamsConfiguration( + MicrosoftTeamsConfigurationReference microsoftTeamsConfiguration) { + this.microsoftTeamsConfiguration = + JsonNullable.of(microsoftTeamsConfiguration); + return this; + } + + /** + * A reference to a Microsoft Teams Configuration resource. + * + * @return microsoftTeamsConfiguration + */ + @jakarta.annotation.Nullable + @JsonIgnore + public MicrosoftTeamsConfigurationReference getMicrosoftTeamsConfiguration() { + return microsoftTeamsConfiguration.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MICROSOFT_TEAMS_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable + getMicrosoftTeamsConfiguration_JsonNullable() { + return microsoftTeamsConfiguration; + } + + @JsonProperty(JSON_PROPERTY_MICROSOFT_TEAMS_CONFIGURATION) + public void setMicrosoftTeamsConfiguration_JsonNullable( + JsonNullable microsoftTeamsConfiguration) { + this.microsoftTeamsConfiguration = microsoftTeamsConfiguration; + } + + public void setMicrosoftTeamsConfiguration( + MicrosoftTeamsConfigurationReference microsoftTeamsConfiguration) { + this.microsoftTeamsConfiguration = + JsonNullable.of(microsoftTeamsConfiguration); + } + + public IncidentTypeRelationships zoomConfiguration(ZoomConfigurationReference zoomConfiguration) { + this.zoomConfiguration = JsonNullable.of(zoomConfiguration); + return this; + } + + /** + * A reference to a Zoom configuration resource. + * + * @return zoomConfiguration + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ZoomConfigurationReference getZoomConfiguration() { + return zoomConfiguration.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ZOOM_CONFIGURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getZoomConfiguration_JsonNullable() { + return zoomConfiguration; + } + + @JsonProperty(JSON_PROPERTY_ZOOM_CONFIGURATION) + public void setZoomConfiguration_JsonNullable( + JsonNullable zoomConfiguration) { + this.zoomConfiguration = zoomConfiguration; + } + + public void setZoomConfiguration(ZoomConfigurationReference zoomConfiguration) { + this.zoomConfiguration = JsonNullable.of(zoomConfiguration); + } + + /** + * 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 IncidentTypeRelationships + */ + @JsonAnySetter + public IncidentTypeRelationships 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 IncidentTypeRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IncidentTypeRelationships incidentTypeRelationships = (IncidentTypeRelationships) o; + return Objects.equals(this.createdByUser, incidentTypeRelationships.createdByUser) + && Objects.equals( + this.googleMeetConfiguration, incidentTypeRelationships.googleMeetConfiguration) + && Objects.equals(this.lastModifiedByUser, incidentTypeRelationships.lastModifiedByUser) + && Objects.equals( + this.microsoftTeamsConfiguration, incidentTypeRelationships.microsoftTeamsConfiguration) + && Objects.equals(this.zoomConfiguration, incidentTypeRelationships.zoomConfiguration) + && Objects.equals( + this.additionalProperties, incidentTypeRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdByUser, + googleMeetConfiguration, + lastModifiedByUser, + microsoftTeamsConfiguration, + zoomConfiguration, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IncidentTypeRelationships {\n"); + sb.append(" createdByUser: ").append(toIndentedString(createdByUser)).append("\n"); + sb.append(" googleMeetConfiguration: ") + .append(toIndentedString(googleMeetConfiguration)) + .append("\n"); + sb.append(" lastModifiedByUser: ").append(toIndentedString(lastModifiedByUser)).append("\n"); + sb.append(" microsoftTeamsConfiguration: ") + .append(toIndentedString(microsoftTeamsConfiguration)) + .append("\n"); + sb.append(" zoomConfiguration: ").append(toIndentedString(zoomConfiguration)).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/MicrosoftTeamsConfigurationReference.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsConfigurationReference.java new file mode 100644 index 00000000000..64f2fedfdbc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsConfigurationReference.java @@ -0,0 +1,153 @@ +/* + * 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 reference to a Microsoft Teams Configuration resource. */ +@JsonPropertyOrder({MicrosoftTeamsConfigurationReference.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsConfigurationReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MicrosoftTeamsConfigurationReferenceData data; + + public MicrosoftTeamsConfigurationReference() {} + + @JsonCreator + public MicrosoftTeamsConfigurationReference( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + MicrosoftTeamsConfigurationReferenceData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public MicrosoftTeamsConfigurationReference data(MicrosoftTeamsConfigurationReferenceData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + return this; + } + + /** + * The Microsoft Teams configuration relationship data object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MicrosoftTeamsConfigurationReferenceData getData() { + return data; + } + + public void setData(MicrosoftTeamsConfigurationReferenceData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MicrosoftTeamsConfigurationReference + */ + @JsonAnySetter + public MicrosoftTeamsConfigurationReference 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 MicrosoftTeamsConfigurationReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsConfigurationReference microsoftTeamsConfigurationReference = + (MicrosoftTeamsConfigurationReference) o; + return Objects.equals(this.data, microsoftTeamsConfigurationReference.data) + && Objects.equals( + this.additionalProperties, microsoftTeamsConfigurationReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsConfigurationReference {\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/MicrosoftTeamsConfigurationReferenceData.java b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsConfigurationReferenceData.java new file mode 100644 index 00000000000..34126fbd12f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MicrosoftTeamsConfigurationReferenceData.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; + +/** The Microsoft Teams configuration relationship data object. */ +@JsonPropertyOrder({ + MicrosoftTeamsConfigurationReferenceData.JSON_PROPERTY_ID, + MicrosoftTeamsConfigurationReferenceData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MicrosoftTeamsConfigurationReferenceData { + @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 MicrosoftTeamsConfigurationReferenceData() {} + + @JsonCreator + public MicrosoftTeamsConfigurationReferenceData( + @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 MicrosoftTeamsConfigurationReferenceData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the Microsoft Teams configuration. + * + * @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 MicrosoftTeamsConfigurationReferenceData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the Microsoft Teams configuration. + * + * @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 MicrosoftTeamsConfigurationReferenceData + */ + @JsonAnySetter + public MicrosoftTeamsConfigurationReferenceData 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 MicrosoftTeamsConfigurationReferenceData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MicrosoftTeamsConfigurationReferenceData microsoftTeamsConfigurationReferenceData = + (MicrosoftTeamsConfigurationReferenceData) o; + return Objects.equals(this.id, microsoftTeamsConfigurationReferenceData.id) + && Objects.equals(this.type, microsoftTeamsConfigurationReferenceData.type) + && Objects.equals( + this.additionalProperties, + microsoftTeamsConfigurationReferenceData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MicrosoftTeamsConfigurationReferenceData {\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/PatchIncidentNotificationTemplateRequest.java b/src/main/java/com/datadog/api/client/v2/model/PatchIncidentNotificationTemplateRequest.java new file mode 100644 index 00000000000..086e34d36b0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchIncidentNotificationTemplateRequest.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.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; + +/** Update request for a notification template. */ +@JsonPropertyOrder({PatchIncidentNotificationTemplateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchIncidentNotificationTemplateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IncidentNotificationTemplateUpdateData data; + + public PatchIncidentNotificationTemplateRequest() {} + + @JsonCreator + public PatchIncidentNotificationTemplateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + IncidentNotificationTemplateUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public PatchIncidentNotificationTemplateRequest data( + IncidentNotificationTemplateUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Notification template data for an update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentNotificationTemplateUpdateData getData() { + return data; + } + + public void setData(IncidentNotificationTemplateUpdateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchIncidentNotificationTemplateRequest + */ + @JsonAnySetter + public PatchIncidentNotificationTemplateRequest 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 PatchIncidentNotificationTemplateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchIncidentNotificationTemplateRequest patchIncidentNotificationTemplateRequest = + (PatchIncidentNotificationTemplateRequest) o; + return Objects.equals(this.data, patchIncidentNotificationTemplateRequest.data) + && Objects.equals( + this.additionalProperties, + patchIncidentNotificationTemplateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchIncidentNotificationTemplateRequest {\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/RelationshipToIncidentType.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentType.java new file mode 100644 index 00000000000..5a0677880c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentType.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship to an incident type. */ +@JsonPropertyOrder({RelationshipToIncidentType.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToIncidentType { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RelationshipToIncidentTypeData data; + + public RelationshipToIncidentType() {} + + @JsonCreator + public RelationshipToIncidentType( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RelationshipToIncidentTypeData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RelationshipToIncidentType data(RelationshipToIncidentTypeData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship to incident type object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RelationshipToIncidentTypeData getData() { + return data; + } + + public void setData(RelationshipToIncidentTypeData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RelationshipToIncidentType + */ + @JsonAnySetter + public RelationshipToIncidentType 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 RelationshipToIncidentType object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToIncidentType relationshipToIncidentType = (RelationshipToIncidentType) o; + return Objects.equals(this.data, relationshipToIncidentType.data) + && Objects.equals( + this.additionalProperties, relationshipToIncidentType.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToIncidentType {\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/RelationshipToIncidentTypeData.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentTypeData.java new file mode 100644 index 00000000000..73360ae58c4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToIncidentTypeData.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; + +/** Relationship to incident type object. */ +@JsonPropertyOrder({ + RelationshipToIncidentTypeData.JSON_PROPERTY_ID, + RelationshipToIncidentTypeData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RelationshipToIncidentTypeData { + @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 IncidentTypeType type = IncidentTypeType.INCIDENT_TYPES; + + public RelationshipToIncidentTypeData() {} + + @JsonCreator + public RelationshipToIncidentTypeData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) IncidentTypeType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RelationshipToIncidentTypeData id(String id) { + this.id = id; + return this; + } + + /** + * The incident type's 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 RelationshipToIncidentTypeData type(IncidentTypeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Incident type resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IncidentTypeType getType() { + return type; + } + + public void setType(IncidentTypeType 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 RelationshipToIncidentTypeData + */ + @JsonAnySetter + public RelationshipToIncidentTypeData 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 RelationshipToIncidentTypeData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToIncidentTypeData relationshipToIncidentTypeData = + (RelationshipToIncidentTypeData) o; + return Objects.equals(this.id, relationshipToIncidentTypeData.id) + && Objects.equals(this.type, relationshipToIncidentTypeData.type) + && Objects.equals( + this.additionalProperties, relationshipToIncidentTypeData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToIncidentTypeData {\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/ZoomConfigurationReference.java b/src/main/java/com/datadog/api/client/v2/model/ZoomConfigurationReference.java new file mode 100644 index 00000000000..b86d5b16e72 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ZoomConfigurationReference.java @@ -0,0 +1,152 @@ +/* + * 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 reference to a Zoom configuration resource. */ +@JsonPropertyOrder({ZoomConfigurationReference.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ZoomConfigurationReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ZoomConfigurationReferenceData data; + + public ZoomConfigurationReference() {} + + @JsonCreator + public ZoomConfigurationReference( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ZoomConfigurationReferenceData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public ZoomConfigurationReference data(ZoomConfigurationReferenceData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + return this; + } + + /** + * The Zoom configuration relationship data object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ZoomConfigurationReferenceData getData() { + return data; + } + + public void setData(ZoomConfigurationReferenceData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ZoomConfigurationReference + */ + @JsonAnySetter + public ZoomConfigurationReference 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 ZoomConfigurationReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ZoomConfigurationReference zoomConfigurationReference = (ZoomConfigurationReference) o; + return Objects.equals(this.data, zoomConfigurationReference.data) + && Objects.equals( + this.additionalProperties, zoomConfigurationReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ZoomConfigurationReference {\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/ZoomConfigurationReferenceData.java b/src/main/java/com/datadog/api/client/v2/model/ZoomConfigurationReferenceData.java new file mode 100644 index 00000000000..c58b3100bd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ZoomConfigurationReferenceData.java @@ -0,0 +1,175 @@ +/* + * 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 Zoom configuration relationship data object. */ +@JsonPropertyOrder({ + ZoomConfigurationReferenceData.JSON_PROPERTY_ID, + ZoomConfigurationReferenceData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ZoomConfigurationReferenceData { + @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 ZoomConfigurationReferenceData() {} + + @JsonCreator + public ZoomConfigurationReferenceData( + @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 ZoomConfigurationReferenceData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the Zoom configuration. + * + * @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 ZoomConfigurationReferenceData type(String type) { + this.type = type; + return this; + } + + /** + * The type of the Zoom configuration. + * + * @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 ZoomConfigurationReferenceData + */ + @JsonAnySetter + public ZoomConfigurationReferenceData 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 ZoomConfigurationReferenceData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ZoomConfigurationReferenceData zoomConfigurationReferenceData = + (ZoomConfigurationReferenceData) o; + return Objects.equals(this.id, zoomConfigurationReferenceData.id) + && Objects.equals(this.type, zoomConfigurationReferenceData.type) + && Objects.equals( + this.additionalProperties, zoomConfigurationReferenceData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ZoomConfigurationReferenceData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json b/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json index 71e89162830..865c18a3146 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd3" + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd5" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..85abdb74054 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:18:37.406Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.json new file mode 100644 index 00000000000..39ac9337458 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"alert\",\"content\":\"An incident has been declared. Please join the incident channel for updates.\",\"name\":\"Test Template\",\"subject\":\"Incident Alert\"},\"type\":\"invalid_type\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/notification-templates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"invalid_type\\\" expected one of \\\"notification_templates\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f1ecffd6-85a9-4acd-c8e0-98f5bb46bc53" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.freeze new file mode 100644 index 00000000000..c0fd62cbb97 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:18:47.764Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.json new file mode 100644 index 00000000000..fa3ede4d92c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Created_response.json @@ -0,0 +1,104 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"name\":\"Security Incident\"},\"type\":\"incident_types\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/types", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"943312c7-755d-4167-9bd4-bd87603c1784\",\"type\":\"incident_types\",\"attributes\":{\"createdAt\":\"2025-09-05T02:18:47.87671627Z\",\"createdBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"lastModifiedBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modifiedAt\":\"2025-09-05T02:18:47.876716352Z\",\"name\":\"Security Incident\",\"prefix\":\"IR\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"google_meet_configuration\":{\"data\":null},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"microsoft_teams_configuration\":{\"data\":null},\"zoom_configuration\":{\"data\":null}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd1" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"alert\",\"content\":\"An incident has been declared.\\n\\nTitle: Sample Incident Title\\nSeverity: SEV-2\\nAffected Services: web-service, database-service\\nStatus: active\\n\\nPlease join the incident channel for updates.\",\"name\":\"Test-Create_incident_notification_template_returns_Created_response-1757038727\",\"subject\":\"SEV-2 Incident: Sample Incident Title\"},\"relationships\":{\"incident_type\":{\"data\":{\"id\":\"943312c7-755d-4167-9bd4-bd87603c1784\",\"type\":\"incident_types\"}}},\"type\":\"notification_templates\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/notification-templates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ffbd2758-c695-4879-8355-07371b09aeea\",\"type\":\"notification_templates\",\"attributes\":{\"category\":\"alert\",\"content\":\"An incident has been declared.\\n\\nTitle: Sample Incident Title\\nSeverity: SEV-2\\nAffected Services: web-service, database-service\\nStatus: active\\n\\nPlease join the incident channel for updates.\",\"created\":\"2025-09-05T02:18:48.112073Z\",\"modified\":\"2025-09-05T02:18:48.112073Z\",\"name\":\"Test-Create_incident_notification_template_returns_Created_response-1757038727\",\"subject\":\"SEV-2 Incident: Sample Incident Title\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"incident_type\":{\"data\":{\"id\":\"943312c7-755d-4167-9bd4-bd87603c1784\",\"type\":\"incident_types\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d227954b-3a2d-fd42-2958-7303ffa1c9e4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/notification-templates/ffbd2758-c695-4879-8355-07371b09aeea", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cc62ba70-349d-2aa5-41ec-6d6952278a1a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/types/943312c7-755d-4167-9bd4-bd87603c1784", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e4267e0a-de74-c014-f3ba-6c5a74687822" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..7f9ff96ec20 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:18:58.276Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.json new file mode 100644 index 00000000000..a4d6abe2c57 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_incident_notification_template_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"alert\",\"content\":\"An incident has been declared. Please join the incident channel for updates.\",\"name\":\"Incident Alert Template\",\"subject\":\"Incident Alert\"},\"relationships\":{\"incident_type\":{\"data\":{\"id\":\"00000000-1111-2222-3333-444444444444\",\"type\":\"incident_types\"}}},\"type\":\"notification_templates\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/notification-templates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"incident type not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "764d22c7-24e8-d860-fbbf-dd0f436c6d9c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json index 8dd384c98ef..8795d36c42f 100644 --- a/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd1" + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd2" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.freeze new file mode 100644 index 00000000000..4e2a947c4cf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:19:08.418Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.json new file mode 100644 index 00000000000..520f2829a53 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_incident_notification_template_returns_No_Content_response.json @@ -0,0 +1,130 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"name\":\"Security Incident\"},\"type\":\"incident_types\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/types", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d067e172-1ce4-4b59-ae6e-3f867e98c81e\",\"type\":\"incident_types\",\"attributes\":{\"createdAt\":\"2025-09-05T02:19:08.514411675Z\",\"createdBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"lastModifiedBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modifiedAt\":\"2025-09-05T02:19:08.514411774Z\",\"name\":\"Security Incident\",\"prefix\":\"IR\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"google_meet_configuration\":{\"data\":null},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"microsoft_teams_configuration\":{\"data\":null},\"zoom_configuration\":{\"data\":null}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd3" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"alert\",\"content\":\"Test notification template\",\"name\":\"Test Template Test-Delete_incident_notification_template_returns_No_Content_response-1757038748\",\"subject\":\"Test Subject\"},\"relationships\":{\"incident_type\":{\"data\":{\"id\":\"d067e172-1ce4-4b59-ae6e-3f867e98c81e\",\"type\":\"incident_types\"}}},\"type\":\"notification_templates\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/notification-templates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"15bb5f88-fdc8-45be-9b38-348cb42d421e\",\"type\":\"notification_templates\",\"attributes\":{\"category\":\"alert\",\"content\":\"Test notification template\",\"created\":\"2025-09-05T02:19:08.730505Z\",\"modified\":\"2025-09-05T02:19:08.730505Z\",\"name\":\"Test Template Test-Delete_incident_notification_template_returns_No_Content_response-1757038748\",\"subject\":\"Test Subject\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"incident_type\":{\"data\":{\"id\":\"d067e172-1ce4-4b59-ae6e-3f867e98c81e\",\"type\":\"incident_types\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8b9b9531-c285-eb4a-8c91-ea4652e57bee" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/notification-templates/15bb5f88-fdc8-45be-9b38-348cb42d421e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1376cac6-af4f-788b-c760-cdc56734c358" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/notification-templates/15bb5f88-fdc8-45be-9b38-348cb42d421e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1376cac6-af4f-788b-c760-cdc56734c359" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/types/d067e172-1ce4-4b59-ae6e-3f867e98c81e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8c898490-3eae-2862-f367-5e1f82e42d40" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.freeze new file mode 100644 index 00000000000..c4186b1c9dd --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:19:18.985Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.json new file mode 100644 index 00000000000..fae631ce4f3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_incident_notification_template_returns_OK_response.json @@ -0,0 +1,130 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"name\":\"Security Incident\"},\"type\":\"incident_types\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/types", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"64f3b511-c83f-46cd-a07c-0120372df2d1\",\"type\":\"incident_types\",\"attributes\":{\"createdAt\":\"2025-09-05T02:19:19.082876806Z\",\"createdBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"lastModifiedBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modifiedAt\":\"2025-09-05T02:19:19.082876888Z\",\"name\":\"Security Incident\",\"prefix\":\"IR\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"google_meet_configuration\":{\"data\":null},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"microsoft_teams_configuration\":{\"data\":null},\"zoom_configuration\":{\"data\":null}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd7" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"alert\",\"content\":\"Test notification template\",\"name\":\"Test Template Test-Get_incident_notification_template_returns_OK_response-1757038758\",\"subject\":\"Test Subject\"},\"relationships\":{\"incident_type\":{\"data\":{\"id\":\"64f3b511-c83f-46cd-a07c-0120372df2d1\",\"type\":\"incident_types\"}}},\"type\":\"notification_templates\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/notification-templates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"85266d98-836e-4981-84ce-ffd443885b5c\",\"type\":\"notification_templates\",\"attributes\":{\"category\":\"alert\",\"content\":\"Test notification template\",\"created\":\"2025-09-05T02:19:19.310014Z\",\"modified\":\"2025-09-05T02:19:19.310014Z\",\"name\":\"Test Template Test-Get_incident_notification_template_returns_OK_response-1757038758\",\"subject\":\"Test Subject\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"incident_type\":{\"data\":{\"id\":\"64f3b511-c83f-46cd-a07c-0120372df2d1\",\"type\":\"incident_types\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d9eb4494-1acc-aa9a-c6d3-77011e1c61b9" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/incidents/config/notification-templates/85266d98-836e-4981-84ce-ffd443885b5c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"85266d98-836e-4981-84ce-ffd443885b5c\",\"type\":\"notification_templates\",\"attributes\":{\"category\":\"alert\",\"content\":\"Test notification template\",\"created\":\"2025-09-05T02:19:19.310014Z\",\"modified\":\"2025-09-05T02:19:19.310014Z\",\"name\":\"Test Template Test-Get_incident_notification_template_returns_OK_response-1757038758\",\"subject\":\"Test Subject\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"incident_type\":{\"data\":{\"id\":\"64f3b511-c83f-46cd-a07c-0120372df2d1\",\"type\":\"incident_types\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fe57b22e-ab0c-9541-24f2-28518c8b5b65" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/notification-templates/85266d98-836e-4981-84ce-ffd443885b5c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "430b0422-6514-e667-85b3-d9be26bb1a0a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/types/64f3b511-c83f-46cd-a07c-0120372df2d1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bd7bf6e5-e116-72c6-7e86-88810b309a41" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.freeze new file mode 100644 index 00000000000..8f764636135 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:19:29.855Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.json new file mode 100644 index 00000000000..55ec30f4767 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_incident_notification_templates_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/incidents/config/notification-templates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "239ef584-e5d5-3bf6-80e3-87340aeb07b5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json index 4ae3a331b62..11c3665bc4d 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd2" + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd4" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..ae9019f158c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:19:40.063Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.json new file mode 100644 index 00000000000..86b579c466a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"update\",\"content\":\"Incident Status Update: For more details, visit the incident page.\",\"name\":\"Update Template\",\"subject\":\"Incident Update\"},\"id\":\"00000000-0000-0000-0000-000000000001\",\"type\":\"invalid_type\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/incidents/config/notification-templates/00000000-1111-2222-3333-444444444444", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"invalid_type\\\" expected one of \\\"notification_templates\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7038fe00-fae7-bb0b-e89c-229934a1a6a2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..ae65c791ecf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:19:50.591Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.json new file mode 100644 index 00000000000..0dd09abbb99 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"update\",\"content\":\"Incident Status Update: For more details, visit the incident page.\",\"name\":\"Updated Template Name\",\"subject\":\"Incident Update\"},\"id\":\"00000000-1111-2222-3333-444444444444\",\"type\":\"notification_templates\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/incidents/config/notification-templates/00000000-1111-2222-3333-444444444444", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "28f28077-c17e-6421-484c-a16d3a354df9" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.freeze new file mode 100644 index 00000000000..62fac8296cb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-09-05T02:20:00.641Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.json new file mode 100644 index 00000000000..35480b47097 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_incident_notification_template_returns_OK_response.json @@ -0,0 +1,134 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"name\":\"Security Incident\"},\"type\":\"incident_types\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/types", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"614d7660-ec56-4b27-98f5-3a58dfffba02\",\"type\":\"incident_types\",\"attributes\":{\"createdAt\":\"2025-09-05T02:20:00.720888811Z\",\"createdBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"description\":\"Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.\",\"is_default\":false,\"lastModifiedBy\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modifiedAt\":\"2025-09-05T02:20:00.720888909Z\",\"name\":\"Security Incident\",\"prefix\":\"IR\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"google_meet_configuration\":{\"data\":null},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"microsoft_teams_configuration\":{\"data\":null},\"zoom_configuration\":{\"data\":null}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd6" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"alert\",\"content\":\"Test notification template\",\"name\":\"Test Template Test-Update_incident_notification_template_returns_OK_response-1757038800\",\"subject\":\"Test Subject\"},\"relationships\":{\"incident_type\":{\"data\":{\"id\":\"614d7660-ec56-4b27-98f5-3a58dfffba02\",\"type\":\"incident_types\"}}},\"type\":\"notification_templates\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/incidents/config/notification-templates", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"0975a4b5-8190-449c-8342-64dab1a90c65\",\"type\":\"notification_templates\",\"attributes\":{\"category\":\"alert\",\"content\":\"Test notification template\",\"created\":\"2025-09-05T02:20:00.936994Z\",\"modified\":\"2025-09-05T02:20:00.936994Z\",\"name\":\"Test Template Test-Update_incident_notification_template_returns_OK_response-1757038800\",\"subject\":\"Test Subject\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"incident_type\":{\"data\":{\"id\":\"614d7660-ec56-4b27-98f5-3a58dfffba02\",\"type\":\"incident_types\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "576d0bbf-c344-ba74-7838-10eda3807563" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"category\":\"update\",\"content\":\"Incident Status Update:\\n\\nTitle: Sample Incident Title\\nNew Status: resolved\\nSeverity: SEV-2\\nServices: web-service, database-service\\nCommander: John Doe\\n\\nFor more details, visit the incident page.\",\"name\":\"Test-Update_incident_notification_template_returns_OK_response-1757038800\",\"subject\":\"Incident Update: Sample Incident Title - resolved\"},\"id\":\"0975a4b5-8190-449c-8342-64dab1a90c65\",\"type\":\"notification_templates\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/incidents/config/notification-templates/0975a4b5-8190-449c-8342-64dab1a90c65", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"0975a4b5-8190-449c-8342-64dab1a90c65\",\"type\":\"notification_templates\",\"attributes\":{\"category\":\"update\",\"content\":\"Incident Status Update:\\n\\nTitle: Sample Incident Title\\nNew Status: resolved\\nSeverity: SEV-2\\nServices: web-service, database-service\\nCommander: John Doe\\n\\nFor more details, visit the incident page.\",\"created\":\"2025-09-05T02:20:00.936994Z\",\"modified\":\"2025-09-05T02:20:01.067409Z\",\"name\":\"Test-Update_incident_notification_template_returns_OK_response-1757038800\",\"subject\":\"Incident Update: Sample Incident Title - resolved\"},\"relationships\":{\"created_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}},\"incident_type\":{\"data\":{\"id\":\"614d7660-ec56-4b27-98f5-3a58dfffba02\",\"type\":\"incident_types\"}},\"last_modified_by_user\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"users\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "254efdd9-343f-6516-07b7-761f806fb54d" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/notification-templates/0975a4b5-8190-449c-8342-64dab1a90c65", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "12642529-a6b4-844c-4b8b-614311256417" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/incidents/config/types/614d7660-ec56-4b27-98f5-3a58dfffba02", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "55bc228f-4c39-8234-694e-04341a7e035e" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index ef93bc042ea..2fce716f34a 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -249,6 +249,18 @@ "tag": "Incidents", "operationId": "CreateIncident" }, + { + "operationId": "CreateIncidentNotificationTemplate", + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"category\": \"alert\",\n \"content\": \"Test notification template\",\n \"name\": \"Test Template {{ unique }}\",\n \"subject\": \"Test Subject\"\n },\n \"relationships\": {\n \"incident_type\": {\n \"data\": {\n \"id\": \"{{ incident_type.data.id }}\",\n \"type\": \"incident_types\"\n }\n }\n },\n \"type\": \"notification_templates\"\n }\n}" + } + ], + "step": "there is a valid \"notification_template\" in the system", + "key": "notification_template", + "tag": "Incidents" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature index 95314aad345..f381e2e6f0b 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature @@ -146,6 +146,35 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @team:Datadog/incident-app + Scenario: Create incident notification template returns "Bad Request" response + Given operation "CreateIncidentNotificationTemplate" enabled + And new "CreateIncidentNotificationTemplate" request + And body with value {"data": {"attributes": {"category": "alert", "content": "An incident has been declared. Please join the incident channel for updates.", "name": "Test Template", "subject": "Incident Alert"}, "type": "invalid_type"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/incident-app + Scenario: Create incident notification template returns "Created" response + Given there is a valid "incident_type" in the system + And operation "CreateIncidentNotificationTemplate" enabled + And new "CreateIncidentNotificationTemplate" request + And body with value {"data": {"attributes": {"category": "alert", "content": "An incident has been declared.\n\nTitle: Sample Incident Title\nSeverity: SEV-2\nAffected Services: web-service, database-service\nStatus: active\n\nPlease join the incident channel for updates.", "name": "{{ unique }}", "subject": "SEV-2 Incident: Sample Incident Title"}, "relationships": {"incident_type": {"data": {"id": "{{ incident_type.data.id }}", "type": "incident_types"}}}, "type": "notification_templates"}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "notification_templates" + And the response "data.attributes.name" has the same value as "unique" + And the response "data.attributes.category" is equal to "alert" + And the response "data.relationships.incident_type.data.id" has the same value as "incident_type.data.id" + + @team:Datadog/incident-app + Scenario: Create incident notification template returns "Not Found" response + Given operation "CreateIncidentNotificationTemplate" enabled + And new "CreateIncidentNotificationTemplate" request + And body with value {"data": {"attributes": {"category": "alert", "content": "An incident has been declared. Please join the incident channel for updates.", "name": "Incident Alert Template", "subject": "Incident Alert"}, "relationships": {"incident_type": {"data": {"id": "00000000-1111-2222-3333-444444444444", "type": "incident_types"}}}, "type": "notification_templates"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Create, update, and delete incident attachments returns "Bad Request" response Given operation "UpdateIncidentAttachments" enabled @@ -173,6 +202,30 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: Delete a notification template returns "Bad Request" response + Given operation "DeleteIncidentNotificationTemplate" enabled + And new "DeleteIncidentNotificationTemplate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Delete a notification template returns "No Content" response + Given operation "DeleteIncidentNotificationTemplate" enabled + And new "DeleteIncidentNotificationTemplate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:Datadog/incident-app + Scenario: Delete a notification template returns "Not Found" response + Given operation "DeleteIncidentNotificationTemplate" enabled + And new "DeleteIncidentNotificationTemplate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Delete an existing incident returns "Bad Request" response Given operation "DeleteIncident" enabled @@ -281,6 +334,16 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @team:Datadog/incident-app + Scenario: Delete incident notification template returns "No Content" response + Given there is a valid "incident_type" in the system + And there is a valid "notification_template" in the system + And operation "DeleteIncidentNotificationTemplate" enabled + And new "DeleteIncidentNotificationTemplate" request + And request contains "id" parameter from "notification_template.data.id" + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/incident-app Scenario: Get a list of an incident's integration metadata returns "Bad Request" response Given operation "ListIncidentIntegrations" enabled @@ -450,6 +513,36 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: Get incident notification template returns "Bad Request" response + Given operation "GetIncidentNotificationTemplate" enabled + And new "GetIncidentNotificationTemplate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Get incident notification template returns "Not Found" response + Given operation "GetIncidentNotificationTemplate" enabled + And new "GetIncidentNotificationTemplate" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:Datadog/incident-app + Scenario: Get incident notification template returns "OK" response + Given there is a valid "incident_type" in the system + And there is a valid "notification_template" in the system + And operation "GetIncidentNotificationTemplate" enabled + And new "GetIncidentNotificationTemplate" request + And request contains "id" parameter from "notification_template.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "notification_templates" + And the response "data.id" has the same value as "notification_template.data.id" + And the response "data" has field "attributes" + And the response "data" has field "relationships" + @generated @skip @team:Datadog/incident-app Scenario: Get incident todo details returns "Bad Request" response Given operation "GetIncidentTodo" enabled @@ -531,6 +624,28 @@ Feature: Incidents Then the response status is 200 OK And the response "data.attributes.title" has the same value as "incident.data.attributes.title" + @generated @skip @team:Datadog/incident-app + Scenario: List incident notification templates returns "Bad Request" response + Given operation "ListIncidentNotificationTemplates" enabled + And new "ListIncidentNotificationTemplates" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: List incident notification templates returns "Not Found" response + Given operation "ListIncidentNotificationTemplates" enabled + And new "ListIncidentNotificationTemplates" request + When the request is sent + Then the response status is 404 Not Found + + @team:Datadog/incident-app + Scenario: List incident notification templates returns "OK" response + Given operation "ListIncidentNotificationTemplates" enabled + And new "ListIncidentNotificationTemplates" request + When the request is sent + Then the response status is 200 OK + And the response "data" has length 0 + @team:DataDog/incident-app Scenario: Remove commander from an incident returns "OK" response Given operation "UpdateIncident" enabled @@ -702,3 +817,36 @@ Feature: Incidents And body with value {"data": {"id": "{{incident_type.data.id}}", "attributes": {"name": "{{incident_type.data.attributes.name}}-updated"}, "type": "incident_types"}} When the request is sent Then the response status is 200 OK + + @team:Datadog/incident-app + Scenario: Update incident notification template returns "Bad Request" response + Given operation "UpdateIncidentNotificationTemplate" enabled + And new "UpdateIncidentNotificationTemplate" request + And request contains "id" parameter with value "00000000-1111-2222-3333-444444444444" + And body with value {"data": {"attributes": {"category": "update", "content": "Incident Status Update: For more details, visit the incident page.", "name": "Update Template", "subject": "Incident Update"}, "id": "00000000-0000-0000-0000-000000000001", "type": "invalid_type"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/incident-app + Scenario: Update incident notification template returns "Not Found" response + Given operation "UpdateIncidentNotificationTemplate" enabled + And new "UpdateIncidentNotificationTemplate" request + And request contains "id" parameter with value "00000000-1111-2222-3333-444444444444" + And body with value {"data": {"attributes": {"category": "update", "content": "Incident Status Update: For more details, visit the incident page.", "name": "Updated Template Name", "subject": "Incident Update"}, "id": "00000000-1111-2222-3333-444444444444", "type": "notification_templates"}} + When the request is sent + Then the response status is 404 Not Found + + @team:Datadog/incident-app + Scenario: Update incident notification template returns "OK" response + Given there is a valid "incident_type" in the system + And there is a valid "notification_template" in the system + And operation "UpdateIncidentNotificationTemplate" enabled + And new "UpdateIncidentNotificationTemplate" request + And request contains "id" parameter from "notification_template.data.id" + And body with value {"data": {"attributes": {"category": "update", "content": "Incident Status Update:\n\nTitle: Sample Incident Title\nNew Status: resolved\nSeverity: SEV-2\nServices: web-service, database-service\nCommander: John Doe\n\nFor more details, visit the incident page.", "name": "{{ unique }}", "subject": "Incident Update: Sample Incident Title - resolved"}, "id": "{{ notification_template.data.id }}", "type": "notification_templates"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "notification_templates" + And the response "data.id" has the same value as "notification_template.data.id" + And the response "data.attributes.name" has the same value as "unique" + And the response "data.attributes.category" is equal to "update" 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 1ade02a7370..58051028c29 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 @@ -1089,6 +1089,43 @@ "type": "unsafe" } }, + "ListIncidentNotificationTemplates": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentNotificationTemplate": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentNotificationTemplate", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteIncidentNotificationTemplate": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetIncidentNotificationTemplate": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateIncidentNotificationTemplate": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListIncidentTypes": { "tag": "Incidents", "undo": {