Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -227286,6 +227301,10 @@ paths:
- attributes:
email:
enabled: true
recipient_email: alerts@example.com
servicenow:
templates:
- incident-template
slack:
channel: test-channel
workspace: Datadog
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -42,6 +45,7 @@ def self.attribute_map
:'email' => :'email',
:'ms_teams' => :'ms_teams',
:'pagerduty' => :'pagerduty',
:'servicenow' => :'servicenow',
:'slack' => :'slack'
}
end
Expand All @@ -53,6 +57,7 @@ def self.openapi_types
:'email' => :'TeamNotificationRuleAttributesEmail',
:'ms_teams' => :'TeamNotificationRuleAttributesMsTeams',
:'pagerduty' => :'TeamNotificationRuleAttributesPagerduty',
:'servicenow' => :'TeamNotificationRuleAttributesServiceNow',
:'slack' => :'TeamNotificationRuleAttributesSlack'
}
end
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,26 @@ 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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'enabled' => :'Boolean'
:'enabled' => :'Boolean',
:'recipient_email' => :'String'
}
end

Expand All @@ -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.
Expand Down Expand Up @@ -92,14 +101,15 @@ 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

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[enabled, additional_properties].hash
[enabled, recipient_email, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -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<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::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
Loading