diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4d2fffc0cf47..5c3bc0338526 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -120947,6 +120947,8 @@ components: $ref: "#/components/schemas/TeamNotificationRuleAttributesMsTeams" pagerduty: $ref: "#/components/schemas/TeamNotificationRuleAttributesPagerduty" + servicenow: + $ref: "#/components/schemas/TeamNotificationRuleAttributesServiceNow" slack: $ref: "#/components/schemas/TeamNotificationRuleAttributesSlack" type: object @@ -120956,6 +120958,10 @@ components: enabled: description: Flag indicating email notification type: boolean + recipient_email: + description: >- + Email address to notify. When omitted and email notifications are enabled, notifications are sent to all team members. + type: string type: object TeamNotificationRuleAttributesMsTeams: description: MS Teams notification settings for the team @@ -120971,6 +120977,15 @@ components: description: Service name for PagerDuty type: string type: object + TeamNotificationRuleAttributesServiceNow: + description: ServiceNow notification settings for the team. + properties: + templates: + description: ServiceNow template handle names to use for notifications. + items: + type: string + type: array + type: object TeamNotificationRuleAttributesSlack: description: Slack notification settings for the team properties: @@ -227286,6 +227301,10 @@ paths: - attributes: email: enabled: true + recipient_email: alerts@example.com + servicenow: + templates: + - incident-template slack: channel: test-channel workspace: Datadog diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index dcd76acdd2bd..c50ec8003a99 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -8510,6 +8510,7 @@ def overrides "v2.team_notification_rule_attributes_email" => "TeamNotificationRuleAttributesEmail", "v2.team_notification_rule_attributes_ms_teams" => "TeamNotificationRuleAttributesMsTeams", "v2.team_notification_rule_attributes_pagerduty" => "TeamNotificationRuleAttributesPagerduty", + "v2.team_notification_rule_attributes_service_now" => "TeamNotificationRuleAttributesServiceNow", "v2.team_notification_rule_attributes_slack" => "TeamNotificationRuleAttributesSlack", "v2.team_notification_rule_request" => "TeamNotificationRuleRequest", "v2.team_notification_rule_response" => "TeamNotificationRuleResponse", diff --git a/lib/datadog_api_client/v2/models/team_notification_rule_attributes.rb b/lib/datadog_api_client/v2/models/team_notification_rule_attributes.rb index 91499b185ab8..86dc2a8ae7c1 100644 --- a/lib/datadog_api_client/v2/models/team_notification_rule_attributes.rb +++ b/lib/datadog_api_client/v2/models/team_notification_rule_attributes.rb @@ -30,6 +30,9 @@ class TeamNotificationRuleAttributes # PagerDuty notification settings for the team attr_accessor :pagerduty + # ServiceNow notification settings for the team. + attr_accessor :servicenow + # Slack notification settings for the team attr_accessor :slack @@ -42,6 +45,7 @@ def self.attribute_map :'email' => :'email', :'ms_teams' => :'ms_teams', :'pagerduty' => :'pagerduty', + :'servicenow' => :'servicenow', :'slack' => :'slack' } end @@ -53,6 +57,7 @@ def self.openapi_types :'email' => :'TeamNotificationRuleAttributesEmail', :'ms_teams' => :'TeamNotificationRuleAttributesMsTeams', :'pagerduty' => :'TeamNotificationRuleAttributesPagerduty', + :'servicenow' => :'TeamNotificationRuleAttributesServiceNow', :'slack' => :'TeamNotificationRuleAttributesSlack' } end @@ -87,6 +92,10 @@ def initialize(attributes = {}) self.pagerduty = attributes[:'pagerduty'] end + if attributes.key?(:'servicenow') + self.servicenow = attributes[:'servicenow'] + end + if attributes.key?(:'slack') self.slack = attributes[:'slack'] end @@ -121,6 +130,7 @@ def ==(o) email == o.email && ms_teams == o.ms_teams && pagerduty == o.pagerduty && + servicenow == o.servicenow && slack == o.slack && additional_properties == o.additional_properties end @@ -129,7 +139,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [email, ms_teams, pagerduty, slack, additional_properties].hash + [email, ms_teams, pagerduty, servicenow, slack, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/team_notification_rule_attributes_email.rb b/lib/datadog_api_client/v2/models/team_notification_rule_attributes_email.rb index 8c82fdeb13c4..397cfae69356 100644 --- a/lib/datadog_api_client/v2/models/team_notification_rule_attributes_email.rb +++ b/lib/datadog_api_client/v2/models/team_notification_rule_attributes_email.rb @@ -24,13 +24,17 @@ class TeamNotificationRuleAttributesEmail # Flag indicating email notification attr_accessor :enabled + # Email address to notify. When omitted and email notifications are enabled, notifications are sent to all team members. + attr_accessor :recipient_email + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { - :'enabled' => :'enabled' + :'enabled' => :'enabled', + :'recipient_email' => :'recipient_email' } end @@ -38,7 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'enabled' => :'Boolean' + :'enabled' => :'Boolean', + :'recipient_email' => :'String' } end @@ -63,6 +68,10 @@ def initialize(attributes = {}) if attributes.key?(:'enabled') self.enabled = attributes[:'enabled'] end + + if attributes.key?(:'recipient_email') + self.recipient_email = attributes[:'recipient_email'] + end end # Returns the object in the form of hash, with additionalProperties support. @@ -92,6 +101,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && enabled == o.enabled && + recipient_email == o.recipient_email && additional_properties == o.additional_properties end @@ -99,7 +109,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [enabled, additional_properties].hash + [enabled, recipient_email, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/team_notification_rule_attributes_service_now.rb b/lib/datadog_api_client/v2/models/team_notification_rule_attributes_service_now.rb new file mode 100644 index 000000000000..7e11c415196f --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_notification_rule_attributes_service_now.rb @@ -0,0 +1,107 @@ +=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 + # ServiceNow notification settings for the team. + class TeamNotificationRuleAttributesServiceNow + include BaseGenericModel + + # ServiceNow template handle names to use for notifications. + attr_accessor :templates + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'templates' => :'templates' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'templates' => :'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::TeamNotificationRuleAttributesServiceNow` 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?(:'templates') + if (value = attributes[:'templates']).is_a?(Array) + self.templates = value + end + 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 && + templates == o.templates && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [templates, additional_properties].hash + end + end +end