From c616f21db1243e6de41177e8845b764a841b8508 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 8 Sep 2025 18:22:08 +0000 Subject: [PATCH] Regenerate client from commit 6f3b8e8 of spec repo --- .generator/schemas/v2/openapi.yaml | 613 ++++++++++++++++++ ...mplate-returns-Bad-Request-response.frozen | 1 + ...-template-returns-Bad-Request-response.yml | 27 + ...n-template-returns-Created-response.frozen | 1 + ...tion-template-returns-Created-response.yml | 91 +++ ...template-returns-Not-Found-response.frozen | 1 + ...on-template-returns-Not-Found-response.yml | 26 + ...emplate-returns-No-Content-response.frozen | 1 + ...n-template-returns-No-Content-response.yml | 106 +++ ...cation-template-returns-OK-response.frozen | 1 + ...ification-template-returns-OK-response.yml | 109 ++++ ...ation-templates-returns-OK-response.frozen | 1 + ...fication-templates-returns-OK-response.yml | 20 + ...mplate-returns-Bad-Request-response.frozen | 1 + ...-template-returns-Bad-Request-response.yml | 27 + ...template-returns-Not-Found-response.frozen | 1 + ...on-template-returns-Not-Found-response.yml | 26 + ...cation-template-returns-OK-response.frozen | 1 + ...ification-template-returns-OK-response.yml | 118 ++++ .../CreateIncidentNotificationTemplate.rb | 31 + .../DeleteIncidentNotificationTemplate.rb | 8 + ...IncidentNotificationTemplate_1602689347.rb | 11 + .../GetIncidentNotificationTemplate.rb | 11 + .../ListIncidentNotificationTemplates.rb | 8 + .../UpdateIncidentNotificationTemplate.rb | 24 + features/scenarios_model_mapping.rb | 20 + features/v2/given.json | 12 + features/v2/incidents.feature | 148 +++++ features/v2/undo.json | 37 ++ lib/datadog_api_client/configuration.rb | 5 + lib/datadog_api_client/inflector.rb | 25 + .../v2/api/incidents_api.rb | 369 +++++++++++ ..._incident_notification_template_request.rb | 123 ++++ .../google_meet_configuration_reference.rb | 113 ++++ ...oogle_meet_configuration_reference_data.rb | 144 ++++ .../models/incident_notification_template.rb | 135 ++++ .../incident_notification_template_array.rb | 147 +++++ ...cident_notification_template_array_meta.rb | 105 +++ ...t_notification_template_array_meta_page.rb | 115 ++++ ...cident_notification_template_attributes.rb | 228 +++++++ ...notification_template_create_attributes.rb | 186 ++++++ ...ident_notification_template_create_data.rb | 154 +++++ ...tion_template_create_data_relationships.rb | 105 +++ ...nt_notification_template_included_items.rb | 63 ++ ...ent_notification_template_relationships.rb | 125 ++++ ...ent_notification_template_response_data.rb | 164 +++++ .../incident_notification_template_type.rb | 26 + ...notification_template_update_attributes.rb | 135 ++++ ...ident_notification_template_update_data.rb | 154 +++++ .../v2/models/incident_type_object.rb | 12 +- .../v2/models/incident_type_relationships.rb | 155 +++++ ...microsoft_teams_configuration_reference.rb | 113 ++++ ...soft_teams_configuration_reference_data.rb | 144 ++++ ..._incident_notification_template_request.rb | 123 ++++ .../models/relationship_to_incident_type.rb | 123 ++++ .../relationship_to_incident_type_data.rb | 144 ++++ .../v2/models/zoom_configuration_reference.rb | 113 ++++ .../zoom_configuration_reference_data.rb | 144 ++++ 58 files changed, 5173 insertions(+), 1 deletion(-) create mode 100644 cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.frozen create mode 100644 cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.yml create mode 100644 cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.yml create mode 100644 cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.frozen create mode 100644 cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.yml create mode 100644 cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.frozen create mode 100644 cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.yml create mode 100644 cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.frozen create mode 100644 cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.yml create mode 100644 examples/v2/incidents/CreateIncidentNotificationTemplate.rb create mode 100644 examples/v2/incidents/DeleteIncidentNotificationTemplate.rb create mode 100644 examples/v2/incidents/DeleteIncidentNotificationTemplate_1602689347.rb create mode 100644 examples/v2/incidents/GetIncidentNotificationTemplate.rb create mode 100644 examples/v2/incidents/ListIncidentNotificationTemplates.rb create mode 100644 examples/v2/incidents/UpdateIncidentNotificationTemplate.rb create mode 100644 lib/datadog_api_client/v2/models/create_incident_notification_template_request.rb create mode 100644 lib/datadog_api_client/v2/models/google_meet_configuration_reference.rb create mode 100644 lib/datadog_api_client/v2/models/google_meet_configuration_reference_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_array.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_array_meta.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_array_meta_page.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_create_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_included_items.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_notification_template_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_type_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference.rb create mode 100644 lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference_data.rb create mode 100644 lib/datadog_api_client/v2/models/patch_incident_notification_template_request.rb create mode 100644 lib/datadog_api_client/v2/models/relationship_to_incident_type.rb create mode 100644 lib/datadog_api_client/v2/models/relationship_to_incident_type_data.rb create mode 100644 lib/datadog_api_client/v2/models/zoom_configuration_reference.rb create mode 100644 lib/datadog_api_client/v2/models/zoom_configuration_reference_data.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2f4dce9e3c26..21a2d895b20c 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/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.frozen b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..85abdb74054b --- /dev/null +++ b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:18:37.406Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.yml b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..abd777fc3a9a --- /dev/null +++ b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Bad-Request-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:18:37 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"invalid_type\" expected one of \"notification_templates\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.frozen b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.frozen new file mode 100644 index 000000000000..c0fd62cbb972 --- /dev/null +++ b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:18:47.764Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.yml b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.yml new file mode 100644 index 000000000000..92c7becd6a5e --- /dev/null +++ b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Created-response.yml @@ -0,0 +1,91 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:18:47 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/types + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:18:47 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:18:47 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/ffbd2758-c695-4879-8355-07371b09aeea + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 05 Sep 2025 02:18:47 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/types/943312c7-755d-4167-9bd4-bd87603c1784 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.frozen b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..7f9ff96ec208 --- /dev/null +++ b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:18:58.276Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.yml b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.yml new file mode 100644 index 000000000000..46bf0add0e43 --- /dev/null +++ b/cassettes/features/v2/incidents/Create-incident-notification-template-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:18:58 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"incident type not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.frozen b/cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.frozen new file mode 100644 index 000000000000..4e2a947c4cf5 --- /dev/null +++ b/cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:19:08.418Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.yml b/cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.yml new file mode 100644 index 000000000000..d8ecd2ce1123 --- /dev/null +++ b/cassettes/features/v2/incidents/Delete-incident-notification-template-returns-No-Content-response.yml @@ -0,0 +1,106 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:19:08 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/types + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:19:08 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:19:08 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/15bb5f88-fdc8-45be-9b38-348cb42d421e + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 05 Sep 2025 02:19:08 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/15bb5f88-fdc8-45be-9b38-348cb42d421e + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +- recorded_at: Fri, 05 Sep 2025 02:19:08 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/types/d067e172-1ce4-4b59-ae6e-3f867e98c81e + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.frozen b/cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.frozen new file mode 100644 index 000000000000..c4186b1c9dd6 --- /dev/null +++ b/cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:19:18.985Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.yml b/cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.yml new file mode 100644 index 000000000000..8ee607d5991c --- /dev/null +++ b/cassettes/features/v2/incidents/Get-incident-notification-template-returns-OK-response.yml @@ -0,0 +1,109 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:19:18 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/types + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:19:18 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:19:18 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/85266d98-836e-4981-84ce-ffd443885b5c + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Fri, 05 Sep 2025 02:19:18 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/85266d98-836e-4981-84ce-ffd443885b5c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 05 Sep 2025 02:19:18 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/types/64f3b511-c83f-46cd-a07c-0120372df2d1 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.frozen b/cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.frozen new file mode 100644 index 000000000000..8f764636135f --- /dev/null +++ b/cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:19:29.855Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.yml b/cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.yml new file mode 100644 index 000000000000..9e5110b31c40 --- /dev/null +++ b/cassettes/features/v2/incidents/List-incident-notification-templates-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:19:29 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates + response: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.frozen b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..ae9019f158c7 --- /dev/null +++ b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:19:40.063Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.yml b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..d1f9490ec279 --- /dev/null +++ b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Bad-Request-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:19:40 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/00000000-1111-2222-3333-444444444444 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"invalid_type\" expected one of \"notification_templates\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.frozen b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..ae65c791ecf0 --- /dev/null +++ b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:19:50.591Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.yml b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.yml new file mode 100644 index 000000000000..0ae94766bb0a --- /dev/null +++ b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:19:50 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/00000000-1111-2222-3333-444444444444 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.frozen b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.frozen new file mode 100644 index 000000000000..62fac8296cb0 --- /dev/null +++ b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-09-05T02:20:00.641Z \ No newline at end of file diff --git a/cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.yml b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.yml new file mode 100644 index 000000000000..d78d2d5e294e --- /dev/null +++ b/cassettes/features/v2/incidents/Update-incident-notification-template-returns-OK-response.yml @@ -0,0 +1,118 @@ +http_interactions: +- recorded_at: Fri, 05 Sep 2025 02:20:00 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/types + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:20:00 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 201 + message: Created +- recorded_at: Fri, 05 Sep 2025 02:20:00 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/0975a4b5-8190-449c-8342-64dab1a90c65 + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +- recorded_at: Fri, 05 Sep 2025 02:20:00 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/notification-templates/0975a4b5-8190-449c-8342-64dab1a90c65 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 05 Sep 2025 02:20:00 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/incidents/config/types/614d7660-ec56-4b27-98f5-3a58dfffba02 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/incidents/CreateIncidentNotificationTemplate.rb b/examples/v2/incidents/CreateIncidentNotificationTemplate.rb new file mode 100644 index 000000000000..7dd6671d3c1e --- /dev/null +++ b/examples/v2/incidents/CreateIncidentNotificationTemplate.rb @@ -0,0 +1,31 @@ +# Create incident notification template returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_incident_notification_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "incident_type" in the system +INCIDENT_TYPE_DATA_ID = ENV["INCIDENT_TYPE_DATA_ID"] + +body = DatadogAPIClient::V2::CreateIncidentNotificationTemplateRequest.new({ + data: DatadogAPIClient::V2::IncidentNotificationTemplateCreateData.new({ + attributes: DatadogAPIClient::V2::IncidentNotificationTemplateCreateAttributes.new({ + 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: "Example-Incident", + subject: "SEV-2 Incident: Sample Incident Title", + }), + relationships: DatadogAPIClient::V2::IncidentNotificationTemplateCreateDataRelationships.new({ + incident_type: DatadogAPIClient::V2::RelationshipToIncidentType.new({ + data: DatadogAPIClient::V2::RelationshipToIncidentTypeData.new({ + id: INCIDENT_TYPE_DATA_ID, + type: DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES, + }), + }), + }), + type: DatadogAPIClient::V2::IncidentNotificationTemplateType::NOTIFICATION_TEMPLATES, + }), +}) +p api_instance.create_incident_notification_template(body) diff --git a/examples/v2/incidents/DeleteIncidentNotificationTemplate.rb b/examples/v2/incidents/DeleteIncidentNotificationTemplate.rb new file mode 100644 index 000000000000..0220bc3274db --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentNotificationTemplate.rb @@ -0,0 +1,8 @@ +# Delete a notification template returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_incident_notification_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new +api_instance.delete_incident_notification_template("00000000-0000-0000-0000-000000000001") diff --git a/examples/v2/incidents/DeleteIncidentNotificationTemplate_1602689347.rb b/examples/v2/incidents/DeleteIncidentNotificationTemplate_1602689347.rb new file mode 100644 index 000000000000..3d93a03ec5a0 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentNotificationTemplate_1602689347.rb @@ -0,0 +1,11 @@ +# Delete incident notification template returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_incident_notification_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "notification_template" in the system +NOTIFICATION_TEMPLATE_DATA_ID = ENV["NOTIFICATION_TEMPLATE_DATA_ID"] +api_instance.delete_incident_notification_template(NOTIFICATION_TEMPLATE_DATA_ID) diff --git a/examples/v2/incidents/GetIncidentNotificationTemplate.rb b/examples/v2/incidents/GetIncidentNotificationTemplate.rb new file mode 100644 index 000000000000..61415c86200e --- /dev/null +++ b/examples/v2/incidents/GetIncidentNotificationTemplate.rb @@ -0,0 +1,11 @@ +# Get incident notification template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_incident_notification_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "notification_template" in the system +NOTIFICATION_TEMPLATE_DATA_ID = ENV["NOTIFICATION_TEMPLATE_DATA_ID"] +p api_instance.get_incident_notification_template(NOTIFICATION_TEMPLATE_DATA_ID) diff --git a/examples/v2/incidents/ListIncidentNotificationTemplates.rb b/examples/v2/incidents/ListIncidentNotificationTemplates.rb new file mode 100644 index 000000000000..16cefc1cb480 --- /dev/null +++ b/examples/v2/incidents/ListIncidentNotificationTemplates.rb @@ -0,0 +1,8 @@ +# List incident notification templates returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_incident_notification_templates".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new +p api_instance.list_incident_notification_templates() diff --git a/examples/v2/incidents/UpdateIncidentNotificationTemplate.rb b/examples/v2/incidents/UpdateIncidentNotificationTemplate.rb new file mode 100644 index 000000000000..59b74f25ff60 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentNotificationTemplate.rb @@ -0,0 +1,24 @@ +# Update incident notification template returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_incident_notification_template".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +# there is a valid "notification_template" in the system +NOTIFICATION_TEMPLATE_DATA_ID = ENV["NOTIFICATION_TEMPLATE_DATA_ID"] + +body = DatadogAPIClient::V2::PatchIncidentNotificationTemplateRequest.new({ + data: DatadogAPIClient::V2::IncidentNotificationTemplateUpdateData.new({ + attributes: DatadogAPIClient::V2::IncidentNotificationTemplateUpdateAttributes.new({ + 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: "Example-Incident", + subject: "Incident Update: Sample Incident Title - resolved", + }), + id: NOTIFICATION_TEMPLATE_DATA_ID, + type: DatadogAPIClient::V2::IncidentNotificationTemplateType::NOTIFICATION_TEMPLATES, + }), +}) +p api_instance.update_incident_notification_template(NOTIFICATION_TEMPLATE_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 790fea3c338a..408295b5af9b 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1752,6 +1752,26 @@ "v2.CreateIncident" => { "body" => "IncidentCreateRequest", }, + "v2.ListIncidentNotificationTemplates" => { + "filter_incident_type" => "UUID", + "include" => "String", + }, + "v2.CreateIncidentNotificationTemplate" => { + "body" => "CreateIncidentNotificationTemplateRequest", + }, + "v2.DeleteIncidentNotificationTemplate" => { + "id" => "UUID", + "include" => "String", + }, + "v2.GetIncidentNotificationTemplate" => { + "id" => "UUID", + "include" => "String", + }, + "v2.UpdateIncidentNotificationTemplate" => { + "id" => "UUID", + "include" => "String", + "body" => "PatchIncidentNotificationTemplateRequest", + }, "v2.ListIncidentTypes" => { "include_deleted" => "Boolean", }, diff --git a/features/v2/given.json b/features/v2/given.json index ef93bc042eac..2fce716f34a1 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/incidents.feature b/features/v2/incidents.feature index 95314aad3450..f381e2e6f0b8 100644 --- a/features/v2/incidents.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 1ade02a7370a..58051028c293 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 8eac288152cc..ea05f382d47e 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -222,18 +222,22 @@ def initialize "v2.get_data_deletion_requests": false, "v2.create_incident": false, "v2.create_incident_integration": false, + "v2.create_incident_notification_template": false, "v2.create_incident_todo": false, "v2.create_incident_type": false, "v2.delete_incident": false, "v2.delete_incident_integration": false, + "v2.delete_incident_notification_template": false, "v2.delete_incident_todo": false, "v2.delete_incident_type": false, "v2.get_incident": false, "v2.get_incident_integration": false, + "v2.get_incident_notification_template": false, "v2.get_incident_todo": false, "v2.get_incident_type": false, "v2.list_incident_attachments": false, "v2.list_incident_integrations": false, + "v2.list_incident_notification_templates": false, "v2.list_incidents": false, "v2.list_incident_todos": false, "v2.list_incident_types": false, @@ -241,6 +245,7 @@ def initialize "v2.update_incident": false, "v2.update_incident_attachments": false, "v2.update_incident_integration": false, + "v2.update_incident_notification_template": false, "v2.update_incident_todo": false, "v2.update_incident_type": false, "v2.create_aws_account": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b5fc02dd717e..5af3a0cd9007 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1554,6 +1554,7 @@ def overrides "v2.create_data_deletion_request_body_data" => "CreateDataDeletionRequestBodyData", "v2.create_data_deletion_request_body_data_type" => "CreateDataDeletionRequestBodyDataType", "v2.create_data_deletion_response_body" => "CreateDataDeletionResponseBody", + "v2.create_incident_notification_template_request" => "CreateIncidentNotificationTemplateRequest", "v2.create_notification_rule_parameters" => "CreateNotificationRuleParameters", "v2.create_notification_rule_parameters_data" => "CreateNotificationRuleParametersData", "v2.create_notification_rule_parameters_data_attributes" => "CreateNotificationRuleParametersDataAttributes", @@ -2061,6 +2062,8 @@ def overrides "v2.gitlab_integration" => "GitlabIntegration", "v2.gitlab_integration_type" => "GitlabIntegrationType", "v2.gitlab_integration_update" => "GitlabIntegrationUpdate", + "v2.google_meet_configuration_reference" => "GoogleMeetConfigurationReference", + "v2.google_meet_configuration_reference_data" => "GoogleMeetConfigurationReferenceData", "v2.grey_noise_api_key" => "GreyNoiseAPIKey", "v2.grey_noise_api_key_type" => "GreyNoiseAPIKeyType", "v2.grey_noise_api_key_update" => "GreyNoiseAPIKeyUpdate", @@ -2145,6 +2148,20 @@ def overrides "v2.incident_integration_relationships" => "IncidentIntegrationRelationships", "v2.incident_non_datadog_creator" => "IncidentNonDatadogCreator", "v2.incident_notification_handle" => "IncidentNotificationHandle", + "v2.incident_notification_template" => "IncidentNotificationTemplate", + "v2.incident_notification_template_array" => "IncidentNotificationTemplateArray", + "v2.incident_notification_template_array_meta" => "IncidentNotificationTemplateArrayMeta", + "v2.incident_notification_template_array_meta_page" => "IncidentNotificationTemplateArrayMetaPage", + "v2.incident_notification_template_attributes" => "IncidentNotificationTemplateAttributes", + "v2.incident_notification_template_create_attributes" => "IncidentNotificationTemplateCreateAttributes", + "v2.incident_notification_template_create_data" => "IncidentNotificationTemplateCreateData", + "v2.incident_notification_template_create_data_relationships" => "IncidentNotificationTemplateCreateDataRelationships", + "v2.incident_notification_template_included_items" => "IncidentNotificationTemplateIncludedItems", + "v2.incident_notification_template_relationships" => "IncidentNotificationTemplateRelationships", + "v2.incident_notification_template_response_data" => "IncidentNotificationTemplateResponseData", + "v2.incident_notification_template_type" => "IncidentNotificationTemplateType", + "v2.incident_notification_template_update_attributes" => "IncidentNotificationTemplateUpdateAttributes", + "v2.incident_notification_template_update_data" => "IncidentNotificationTemplateUpdateData", "v2.incident_postmortem_type" => "IncidentPostmortemType", "v2.incident_related_object" => "IncidentRelatedObject", "v2.incident_responders_type" => "IncidentRespondersType", @@ -2224,6 +2241,7 @@ def overrides "v2.incident_type_object" => "IncidentTypeObject", "v2.incident_type_patch_data" => "IncidentTypePatchData", "v2.incident_type_patch_request" => "IncidentTypePatchRequest", + "v2.incident_type_relationships" => "IncidentTypeRelationships", "v2.incident_type_response" => "IncidentTypeResponse", "v2.incident_type_type" => "IncidentTypeType", "v2.incident_type_update_attributes" => "IncidentTypeUpdateAttributes", @@ -2556,6 +2574,8 @@ def overrides "v2.microsoft_teams_channel_info_response_attributes" => "MicrosoftTeamsChannelInfoResponseAttributes", "v2.microsoft_teams_channel_info_response_data" => "MicrosoftTeamsChannelInfoResponseData", "v2.microsoft_teams_channel_info_type" => "MicrosoftTeamsChannelInfoType", + "v2.microsoft_teams_configuration_reference" => "MicrosoftTeamsConfigurationReference", + "v2.microsoft_teams_configuration_reference_data" => "MicrosoftTeamsConfigurationReferenceData", "v2.microsoft_teams_create_tenant_based_handle_request" => "MicrosoftTeamsCreateTenantBasedHandleRequest", "v2.microsoft_teams_create_workflows_webhook_handle_request" => "MicrosoftTeamsCreateWorkflowsWebhookHandleRequest", "v2.microsoft_teams_get_channel_by_name_response" => "MicrosoftTeamsGetChannelByNameResponse", @@ -2980,6 +3000,7 @@ def overrides "v2.partial_application_key" => "PartialApplicationKey", "v2.partial_application_key_attributes" => "PartialApplicationKeyAttributes", "v2.partial_application_key_response" => "PartialApplicationKeyResponse", + "v2.patch_incident_notification_template_request" => "PatchIncidentNotificationTemplateRequest", "v2.patch_notification_rule_parameters" => "PatchNotificationRuleParameters", "v2.patch_notification_rule_parameters_data" => "PatchNotificationRuleParametersData", "v2.patch_notification_rule_parameters_data_attributes" => "PatchNotificationRuleParametersDataAttributes", @@ -3052,6 +3073,8 @@ def overrides "v2.relationship_to_incident_postmortem_data" => "RelationshipToIncidentPostmortemData", "v2.relationship_to_incident_responder_data" => "RelationshipToIncidentResponderData", "v2.relationship_to_incident_responders" => "RelationshipToIncidentResponders", + "v2.relationship_to_incident_type" => "RelationshipToIncidentType", + "v2.relationship_to_incident_type_data" => "RelationshipToIncidentTypeData", "v2.relationship_to_incident_user_defined_field_data" => "RelationshipToIncidentUserDefinedFieldData", "v2.relationship_to_incident_user_defined_fields" => "RelationshipToIncidentUserDefinedFields", "v2.relationship_to_organization" => "RelationshipToOrganization", @@ -3915,6 +3938,8 @@ def overrides "v2.x_ray_services_include_all" => "XRayServicesIncludeAll", "v2.x_ray_services_include_only" => "XRayServicesIncludeOnly", "v2.x_ray_services_list" => "XRayServicesList", + "v2.zoom_configuration_reference" => "ZoomConfigurationReference", + "v2.zoom_configuration_reference_data" => "ZoomConfigurationReferenceData", # APIs "v1.authentication_api" => "AuthenticationAPI", "v1.aws_integration_api" => "AWSIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index a91ae042ba1e..926634445c59 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -174,6 +174,79 @@ def create_incident_integration_with_http_info(incident_id, body, opts = {}) return data, status_code, headers end + # Create incident notification template. + # + # @see #create_incident_notification_template_with_http_info + def create_incident_notification_template(body, opts = {}) + data, _status_code, _headers = create_incident_notification_template_with_http_info(body, opts) + data + end + + # Create incident notification template. + # + # Creates a new notification template. + # + # @param body [CreateIncidentNotificationTemplateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentNotificationTemplate, Integer, Hash)>] IncidentNotificationTemplate data, response status code and response headers + def create_incident_notification_template_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_notification_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_notification_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_notification_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_notification_template ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_notification_template" + end + # resource path + local_var_path = '/api/v2/incidents/config/notification-templates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentNotificationTemplate' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_incident_notification_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an incident todo. # # @see #create_incident_todo_with_http_info @@ -472,6 +545,79 @@ def delete_incident_integration_with_http_info(incident_id, integration_metadata return data, status_code, headers end + # Delete a notification template. + # + # @see #delete_incident_notification_template_with_http_info + def delete_incident_notification_template(id, opts = {}) + delete_incident_notification_template_with_http_info(id, opts) + nil + end + + # Delete a notification template. + # + # Deletes a notification template by its ID. + # + # @param id [UUID] The ID of the notification template. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_notification_template_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_notification_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_notification_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_notification_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_notification_template ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.delete_incident_notification_template" + end + # resource path + local_var_path = '/api/v2/incidents/config/notification-templates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_incident_notification_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an incident todo. # # @see #delete_incident_todo_with_http_info @@ -768,6 +914,79 @@ def get_incident_integration_with_http_info(incident_id, integration_metadata_id return data, status_code, headers end + # Get incident notification template. + # + # @see #get_incident_notification_template_with_http_info + def get_incident_notification_template(id, opts = {}) + data, _status_code, _headers = get_incident_notification_template_with_http_info(id, opts) + data + end + + # Get incident notification template. + # + # Retrieves a specific notification template by its ID. + # + # @param id [UUID] The ID of the notification template. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` + # @return [Array<(IncidentNotificationTemplate, Integer, Hash)>] IncidentNotificationTemplate data, response status code and response headers + def get_incident_notification_template_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_notification_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_notification_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_notification_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_notification_template ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.get_incident_notification_template" + end + # resource path + local_var_path = '/api/v2/incidents/config/notification-templates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentNotificationTemplate' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_incident_notification_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get incident todo details. # # @see #get_incident_todo_with_http_info @@ -1061,6 +1280,76 @@ def list_incident_integrations_with_http_info(incident_id, opts = {}) return data, status_code, headers end + # List incident notification templates. + # + # @see #list_incident_notification_templates_with_http_info + def list_incident_notification_templates(opts = {}) + data, _status_code, _headers = list_incident_notification_templates_with_http_info(opts) + data + end + + # List incident notification templates. + # + # Lists all notification templates. Optionally filter by incident type. + # + # @param opts [Hash] the optional parameters + # @option opts [UUID] :filter_incident_type Optional incident type ID filter. + # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` + # @return [Array<(IncidentNotificationTemplateArray, Integer, Hash)>] IncidentNotificationTemplateArray data, response status code and response headers + def list_incident_notification_templates_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_notification_templates".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_notification_templates") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_notification_templates")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_notification_templates ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/notification-templates' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentNotificationTemplateArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_notification_templates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_notification_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a list of incidents. # # @see #list_incidents_with_http_info @@ -1645,6 +1934,86 @@ def update_incident_integration_with_http_info(incident_id, integration_metadata return data, status_code, headers end + # Update incident notification template. + # + # @see #update_incident_notification_template_with_http_info + def update_incident_notification_template(id, body, opts = {}) + data, _status_code, _headers = update_incident_notification_template_with_http_info(id, body, opts) + data + end + + # Update incident notification template. + # + # Updates an existing notification template's attributes. + # + # @param id [UUID] The ID of the notification template. + # @param body [PatchIncidentNotificationTemplateRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` + # @return [Array<(IncidentNotificationTemplate, Integer, Hash)>] IncidentNotificationTemplate data, response status code and response headers + def update_incident_notification_template_with_http_info(id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_notification_template".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_notification_template") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_notification_template")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_notification_template ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.update_incident_notification_template" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_notification_template" + end + # resource path + local_var_path = '/api/v2/incidents/config/notification-templates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentNotificationTemplate' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_notification_template, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an incident todo. # # @see #update_incident_todo_with_http_info diff --git a/lib/datadog_api_client/v2/models/create_incident_notification_template_request.rb b/lib/datadog_api_client/v2/models/create_incident_notification_template_request.rb new file mode 100644 index 000000000000..35d5bc62a76f --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_incident_notification_template_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Create request for a notification template. + class CreateIncidentNotificationTemplateRequest + include BaseGenericModel + + # Notification template data for a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentNotificationTemplateCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateIncidentNotificationTemplateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_meet_configuration_reference.rb b/lib/datadog_api_client/v2/models/google_meet_configuration_reference.rb new file mode 100644 index 000000000000..a581147d98f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_meet_configuration_reference.rb @@ -0,0 +1,113 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A reference to a Google Meet Configuration resource. + class GoogleMeetConfigurationReference + include BaseGenericModel + + # The Google Meet configuration relationship data object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GoogleMeetConfigurationReferenceData' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GoogleMeetConfigurationReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_meet_configuration_reference_data.rb b/lib/datadog_api_client/v2/models/google_meet_configuration_reference_data.rb new file mode 100644 index 000000000000..6cfb202050d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_meet_configuration_reference_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The Google Meet configuration relationship data object. + class GoogleMeetConfigurationReferenceData + include BaseGenericModel + + # The unique identifier of the Google Meet configuration. + attr_reader :id + + # The type of the Google Meet configuration. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GoogleMeetConfigurationReferenceData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template.rb b/lib/datadog_api_client/v2/models/incident_notification_template.rb new file mode 100644 index 000000000000..cefd1d3c5b28 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a notification template. + class IncidentNotificationTemplate + include BaseGenericModel + + # Notification template data from a response. + attr_reader :data + + # Related objects that are included in the response. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentNotificationTemplateResponseData', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_array.rb b/lib/datadog_api_client/v2/models/incident_notification_template_array.rb new file mode 100644 index 000000000000..c2c2a74eb3cd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_array.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with notification templates. + class IncidentNotificationTemplateArray + include BaseGenericModel + + # The `NotificationTemplateArray` `data`. + attr_reader :data + + # Related objects that are included in the response. + attr_accessor :included + + # Response metadata. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array', + :'meta' => :'IncidentNotificationTemplateArrayMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_array_meta.rb b/lib/datadog_api_client/v2/models/incident_notification_template_array_meta.rb new file mode 100644 index 000000000000..605434feff78 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_array_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response metadata. + class IncidentNotificationTemplateArrayMeta + include BaseGenericModel + + # Pagination metadata. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'IncidentNotificationTemplateArrayMetaPage' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateArrayMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_array_meta_page.rb b/lib/datadog_api_client/v2/models/incident_notification_template_array_meta_page.rb new file mode 100644 index 000000000000..05d0ff63b141 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_array_meta_page.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata. + class IncidentNotificationTemplateArrayMetaPage + include BaseGenericModel + + # Total number of notification templates. + attr_accessor :total_count + + # Total number of notification templates matching the filter. + attr_accessor :total_filtered_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'total_count', + :'total_filtered_count' => :'total_filtered_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'Integer', + :'total_filtered_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateArrayMetaPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + + if attributes.key?(:'total_filtered_count') + self.total_filtered_count = attributes[:'total_filtered_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + total_filtered_count == o.total_filtered_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_attributes.rb b/lib/datadog_api_client/v2/models/incident_notification_template_attributes.rb new file mode 100644 index 000000000000..fd4417878084 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_attributes.rb @@ -0,0 +1,228 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The notification template's attributes. + class IncidentNotificationTemplateAttributes + include BaseGenericModel + + # The category of the notification template. + attr_reader :category + + # The content body of the notification template. + attr_reader :content + + # Timestamp when the notification template was created. + attr_reader :created + + # Timestamp when the notification template was last modified. + attr_reader :modified + + # The name of the notification template. + attr_reader :name + + # The subject line of the notification template. + attr_reader :subject + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'content' => :'content', + :'created' => :'created', + :'modified' => :'modified', + :'name' => :'name', + :'subject' => :'subject' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'String', + :'content' => :'String', + :'created' => :'Time', + :'modified' => :'Time', + :'name' => :'String', + :'subject' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @category.nil? + return false if @content.nil? + return false if @created.nil? + return false if @modified.nil? + return false if @name.nil? + return false if @subject.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param created [Object] Object to be assigned + # @!visibility private + def created=(created) + if created.nil? + fail ArgumentError, 'invalid value for "created", created cannot be nil.' + end + @created = created + end + + # Custom attribute writer method with validation + # @param modified [Object] Object to be assigned + # @!visibility private + def modified=(modified) + if modified.nil? + fail ArgumentError, 'invalid value for "modified", modified cannot be nil.' + end + @modified = modified + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param subject [Object] Object to be assigned + # @!visibility private + def subject=(subject) + if subject.nil? + fail ArgumentError, 'invalid value for "subject", subject cannot be nil.' + end + @subject = subject + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + content == o.content && + created == o.created && + modified == o.modified && + name == o.name && + subject == o.subject && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, content, created, modified, name, subject, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_create_attributes.rb b/lib/datadog_api_client/v2/models/incident_notification_template_create_attributes.rb new file mode 100644 index 000000000000..320b57f350ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_create_attributes.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes for creating a notification template. + class IncidentNotificationTemplateCreateAttributes + include BaseGenericModel + + # The category of the notification template. + attr_reader :category + + # The content body of the notification template. + attr_reader :content + + # The name of the notification template. + attr_reader :name + + # The subject line of the notification template. + attr_reader :subject + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'content' => :'content', + :'name' => :'name', + :'subject' => :'subject' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'String', + :'content' => :'String', + :'name' => :'String', + :'subject' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @category.nil? + return false if @content.nil? + return false if @name.nil? + return false if @subject.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param subject [Object] Object to be assigned + # @!visibility private + def subject=(subject) + if subject.nil? + fail ArgumentError, 'invalid value for "subject", subject cannot be nil.' + end + @subject = subject + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + content == o.content && + name == o.name && + subject == o.subject && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, content, name, subject, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_create_data.rb b/lib/datadog_api_client/v2/models/incident_notification_template_create_data.rb new file mode 100644 index 000000000000..c56301c6f2cd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_create_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Notification template data for a create request. + class IncidentNotificationTemplateCreateData + include BaseGenericModel + + # The attributes for creating a notification template. + attr_reader :attributes + + # The definition of `NotificationTemplateCreateDataRelationships` object. + attr_accessor :relationships + + # Notification templates resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentNotificationTemplateCreateAttributes', + :'relationships' => :'IncidentNotificationTemplateCreateDataRelationships', + :'type' => :'IncidentNotificationTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_create_data_relationships.rb b/lib/datadog_api_client/v2/models/incident_notification_template_create_data_relationships.rb new file mode 100644 index 000000000000..103fdac1be45 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_create_data_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `NotificationTemplateCreateDataRelationships` object. + class IncidentNotificationTemplateCreateDataRelationships + include BaseGenericModel + + # Relationship to an incident type. + attr_accessor :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'RelationshipToIncidentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateCreateDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_included_items.rb b/lib/datadog_api_client/v2/models/incident_notification_template_included_items.rb new file mode 100644 index 000000000000..3b5685a36336 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_included_items.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Objects related to a notification template. + module IncidentNotificationTemplateIncludedItems + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'User', + :'IncidentTypeObject' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_relationships.rb b/lib/datadog_api_client/v2/models/incident_notification_template_relationships.rb new file mode 100644 index 000000000000..02827bf2b545 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The notification template's resource relationships. + class IncidentNotificationTemplateRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # Relationship to an incident type. + attr_accessor :incident_type + + # Relationship to user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'incident_type' => :'incident_type', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'incident_type' => :'RelationshipToIncidentType', + :'last_modified_by_user' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + incident_type == o.incident_type && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, incident_type, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_response_data.rb b/lib/datadog_api_client/v2/models/incident_notification_template_response_data.rb new file mode 100644 index 000000000000..f53f1633f28b --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_response_data.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Notification template data from a response. + class IncidentNotificationTemplateResponseData + include BaseGenericModel + + # The notification template's attributes. + attr_accessor :attributes + + # The unique identifier of the notification template. + attr_reader :id + + # The notification template's resource relationships. + attr_accessor :relationships + + # Notification templates resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentNotificationTemplateAttributes', + :'id' => :'UUID', + :'relationships' => :'IncidentNotificationTemplateRelationships', + :'type' => :'IncidentNotificationTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_type.rb b/lib/datadog_api_client/v2/models/incident_notification_template_type.rb new file mode 100644 index 000000000000..03ee0c65c21a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Notification templates resource type. + class IncidentNotificationTemplateType + include BaseEnumModel + + NOTIFICATION_TEMPLATES = "notification_templates".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_update_attributes.rb b/lib/datadog_api_client/v2/models/incident_notification_template_update_attributes.rb new file mode 100644 index 000000000000..48852db0e2e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_update_attributes.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes to update on a notification template. + class IncidentNotificationTemplateUpdateAttributes + include BaseGenericModel + + # The category of the notification template. + attr_accessor :category + + # The content body of the notification template. + attr_accessor :content + + # The name of the notification template. + attr_accessor :name + + # The subject line of the notification template. + attr_accessor :subject + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'content' => :'content', + :'name' => :'name', + :'subject' => :'subject' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'String', + :'content' => :'String', + :'name' => :'String', + :'subject' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'subject') + self.subject = attributes[:'subject'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + content == o.content && + name == o.name && + subject == o.subject && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, content, name, subject, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_notification_template_update_data.rb b/lib/datadog_api_client/v2/models/incident_notification_template_update_data.rb new file mode 100644 index 000000000000..0efcb5f27583 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_notification_template_update_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Notification template data for an update request. + class IncidentNotificationTemplateUpdateData + include BaseGenericModel + + # The attributes to update on a notification template. + attr_accessor :attributes + + # The unique identifier of the notification template. + attr_reader :id + + # Notification templates resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentNotificationTemplateUpdateAttributes', + :'id' => :'UUID', + :'type' => :'IncidentNotificationTemplateType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentNotificationTemplateUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_type_object.rb b/lib/datadog_api_client/v2/models/incident_type_object.rb index 2066415169b1..bfa22b295271 100644 --- a/lib/datadog_api_client/v2/models/incident_type_object.rb +++ b/lib/datadog_api_client/v2/models/incident_type_object.rb @@ -27,6 +27,9 @@ class IncidentTypeObject # The incident type's ID. attr_reader :id + # The incident type's resource relationships. + attr_accessor :relationships + # Incident type resource type. attr_reader :type @@ -38,6 +41,7 @@ def self.attribute_map { :'attributes' => :'attributes', :'id' => :'id', + :'relationships' => :'relationships', :'type' => :'type' } end @@ -48,6 +52,7 @@ def self.openapi_types { :'attributes' => :'IncidentTypeAttributes', :'id' => :'String', + :'relationships' => :'IncidentTypeRelationships', :'type' => :'IncidentTypeType' } end @@ -78,6 +83,10 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -140,6 +149,7 @@ def ==(o) self.class == o.class && attributes == o.attributes && id == o.id && + relationships == o.relationships && type == o.type && additional_properties == o.additional_properties end @@ -148,7 +158,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, type, additional_properties].hash + [attributes, id, relationships, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/incident_type_relationships.rb b/lib/datadog_api_client/v2/models/incident_type_relationships.rb new file mode 100644 index 000000000000..7800043b73db --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_type_relationships.rb @@ -0,0 +1,155 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The incident type's resource relationships. + class IncidentTypeRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # A reference to a Google Meet Configuration resource. + attr_accessor :google_meet_configuration + + # Relationship to user. + attr_accessor :last_modified_by_user + + # A reference to a Microsoft Teams Configuration resource. + attr_accessor :microsoft_teams_configuration + + # A reference to a Zoom configuration resource. + attr_accessor :zoom_configuration + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'google_meet_configuration' => :'google_meet_configuration', + :'last_modified_by_user' => :'last_modified_by_user', + :'microsoft_teams_configuration' => :'microsoft_teams_configuration', + :'zoom_configuration' => :'zoom_configuration' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'google_meet_configuration' => :'GoogleMeetConfigurationReference', + :'last_modified_by_user' => :'RelationshipToUser', + :'microsoft_teams_configuration' => :'MicrosoftTeamsConfigurationReference', + :'zoom_configuration' => :'ZoomConfigurationReference' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'google_meet_configuration', + :'microsoft_teams_configuration', + :'zoom_configuration', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTypeRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'google_meet_configuration') + self.google_meet_configuration = attributes[:'google_meet_configuration'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + + if attributes.key?(:'microsoft_teams_configuration') + self.microsoft_teams_configuration = attributes[:'microsoft_teams_configuration'] + end + + if attributes.key?(:'zoom_configuration') + self.zoom_configuration = attributes[:'zoom_configuration'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + google_meet_configuration == o.google_meet_configuration && + last_modified_by_user == o.last_modified_by_user && + microsoft_teams_configuration == o.microsoft_teams_configuration && + zoom_configuration == o.zoom_configuration && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, google_meet_configuration, last_modified_by_user, microsoft_teams_configuration, zoom_configuration, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference.rb b/lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference.rb new file mode 100644 index 000000000000..f27e8625fbe0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference.rb @@ -0,0 +1,113 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A reference to a Microsoft Teams Configuration resource. + class MicrosoftTeamsConfigurationReference + include BaseGenericModel + + # The Microsoft Teams configuration relationship data object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MicrosoftTeamsConfigurationReferenceData' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsConfigurationReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference_data.rb b/lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference_data.rb new file mode 100644 index 000000000000..34b26defb795 --- /dev/null +++ b/lib/datadog_api_client/v2/models/microsoft_teams_configuration_reference_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The Microsoft Teams configuration relationship data object. + class MicrosoftTeamsConfigurationReferenceData + include BaseGenericModel + + # The unique identifier of the Microsoft Teams configuration. + attr_reader :id + + # The type of the Microsoft Teams configuration. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MicrosoftTeamsConfigurationReferenceData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_incident_notification_template_request.rb b/lib/datadog_api_client/v2/models/patch_incident_notification_template_request.rb new file mode 100644 index 000000000000..7ab582dd88d4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_incident_notification_template_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update request for a notification template. + class PatchIncidentNotificationTemplateRequest + include BaseGenericModel + + # Notification template data for an update request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentNotificationTemplateUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PatchIncidentNotificationTemplateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_incident_type.rb b/lib/datadog_api_client/v2/models/relationship_to_incident_type.rb new file mode 100644 index 000000000000..82299d16719b --- /dev/null +++ b/lib/datadog_api_client/v2/models/relationship_to_incident_type.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to an incident type. + class RelationshipToIncidentType + include BaseGenericModel + + # Relationship to incident type object. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RelationshipToIncidentTypeData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToIncidentType` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_incident_type_data.rb b/lib/datadog_api_client/v2/models/relationship_to_incident_type_data.rb new file mode 100644 index 000000000000..cd70a2c2421e --- /dev/null +++ b/lib/datadog_api_client/v2/models/relationship_to_incident_type_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to incident type object. + class RelationshipToIncidentTypeData + include BaseGenericModel + + # The incident type's ID. + attr_reader :id + + # Incident type resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'IncidentTypeType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RelationshipToIncidentTypeData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/zoom_configuration_reference.rb b/lib/datadog_api_client/v2/models/zoom_configuration_reference.rb new file mode 100644 index 000000000000..ee1d697f3283 --- /dev/null +++ b/lib/datadog_api_client/v2/models/zoom_configuration_reference.rb @@ -0,0 +1,113 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A reference to a Zoom configuration resource. + class ZoomConfigurationReference + include BaseGenericModel + + # The Zoom configuration relationship data object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ZoomConfigurationReferenceData' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ZoomConfigurationReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/zoom_configuration_reference_data.rb b/lib/datadog_api_client/v2/models/zoom_configuration_reference_data.rb new file mode 100644 index 000000000000..9552ba0cd0a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/zoom_configuration_reference_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The Zoom configuration relationship data object. + class ZoomConfigurationReferenceData + include BaseGenericModel + + # The unique identifier of the Zoom configuration. + attr_reader :id + + # The type of the Zoom configuration. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ZoomConfigurationReferenceData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end