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
40 changes: 40 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28684,6 +28684,19 @@ components:
type: string
x-enum-varnames:
- INCIDENT_ATTACHMENTS
IncidentCondition:
description: A condition evaluated against incident tags.
properties:
tags:
description: Tags that must match for the condition to pass.
example:
- ''
items:
type: string
type: array
required:
- tags
type: object
IncidentCreateAttributes:
description: The incident's attributes for a create request.
properties:
Expand Down Expand Up @@ -30203,6 +30216,32 @@ components:
user_defined_fields:
$ref: '#/components/schemas/RelationshipToIncidentUserDefinedFields'
type: object
IncidentScheduleTrigger:
description: Trigger a workflow from an Incident Schedule. The workflow must
be published.
properties:
incidentType:
description: Incident type filter for the schedule.
type: string
rrule:
description: Recurrence rule expression for scheduling.
example: ''
type: string
tagCondition:
$ref: '#/components/schemas/IncidentCondition'
required:
- rrule
type: object
IncidentScheduleTriggerWrapper:
description: Schema for an Incident Schedule-based trigger.
properties:
incidentScheduleTrigger:
$ref: '#/components/schemas/IncidentScheduleTrigger'
startStepNames:
$ref: '#/components/schemas/StartStepNames'
required:
- incidentScheduleTrigger
type: object
IncidentSearchResponse:
description: Response with incidents and facets.
properties:
Expand Down Expand Up @@ -65465,6 +65504,7 @@ components:
- $ref: '#/components/schemas/DashboardTriggerWrapper'
- $ref: '#/components/schemas/GithubWebhookTriggerWrapper'
- $ref: '#/components/schemas/IncidentTriggerWrapper'
- $ref: '#/components/schemas/IncidentScheduleTriggerWrapper'
- $ref: '#/components/schemas/MonitorTriggerWrapper'
- $ref: '#/components/schemas/NotebookTriggerWrapper'
- $ref: '#/components/schemas/OnCallTriggerWrapper'
Expand Down
3 changes: 3 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2705,6 +2705,7 @@ def overrides
"v2.http_token_update" => "HTTPTokenUpdate",
"v2.idp_metadata_form_data" => "IdPMetadataFormData",
"v2.incident_attachment_type" => "IncidentAttachmentType",
"v2.incident_condition" => "IncidentCondition",
"v2.incident_create_attributes" => "IncidentCreateAttributes",
"v2.incident_create_data" => "IncidentCreateData",
"v2.incident_create_relationships" => "IncidentCreateRelationships",
Expand Down Expand Up @@ -2796,6 +2797,8 @@ def overrides
"v2.incident_response_meta" => "IncidentResponseMeta",
"v2.incident_response_meta_pagination" => "IncidentResponseMetaPagination",
"v2.incident_response_relationships" => "IncidentResponseRelationships",
"v2.incident_schedule_trigger" => "IncidentScheduleTrigger",
"v2.incident_schedule_trigger_wrapper" => "IncidentScheduleTriggerWrapper",
"v2.incident_search_response" => "IncidentSearchResponse",
"v2.incident_search_response_attributes" => "IncidentSearchResponseAttributes",
"v2.incident_search_response_data" => "IncidentSearchResponseData",
Expand Down
125 changes: 125 additions & 0 deletions lib/datadog_api_client/v2/models/incident_condition.rb
Original file line number Diff line number Diff line change
@@ -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
# A condition evaluated against incident tags.
class IncidentCondition
include BaseGenericModel

# Tags that must match for the condition to pass.
attr_reader :tags

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'tags' => :'tags'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'tags' => :'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::IncidentCondition` 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?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = 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 @tags.nil?
true
end

# Custom attribute writer method with validation
# @param tags [Object] Object to be assigned
# @!visibility private
def tags=(tags)
if tags.nil?
fail ArgumentError, 'invalid value for "tags", tags cannot be nil.'
end
@tags = tags
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 &&
tags == o.tags &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[tags, additional_properties].hash
end
end
end
143 changes: 143 additions & 0 deletions lib/datadog_api_client/v2/models/incident_schedule_trigger.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
=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
# Trigger a workflow from an Incident Schedule. The workflow must be published.
class IncidentScheduleTrigger
include BaseGenericModel

# Incident type filter for the schedule.
attr_accessor :incident_type

# Recurrence rule expression for scheduling.
attr_reader :rrule

# A condition evaluated against incident tags.
attr_accessor :tag_condition

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'incident_type' => :'incidentType',
:'rrule' => :'rrule',
:'tag_condition' => :'tagCondition'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'incident_type' => :'String',
:'rrule' => :'String',
:'tag_condition' => :'IncidentCondition'
}
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::IncidentScheduleTrigger` 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

if attributes.key?(:'rrule')
self.rrule = attributes[:'rrule']
end

if attributes.key?(:'tag_condition')
self.tag_condition = attributes[:'tag_condition']
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 @rrule.nil?
true
end

# Custom attribute writer method with validation
# @param rrule [Object] Object to be assigned
# @!visibility private
def rrule=(rrule)
if rrule.nil?
fail ArgumentError, 'invalid value for "rrule", rrule cannot be nil.'
end
@rrule = rrule
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 &&
rrule == o.rrule &&
tag_condition == o.tag_condition &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[incident_type, rrule, tag_condition, additional_properties].hash
end
end
end
Loading
Loading