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 @@ -41678,6 +41678,24 @@ components:
- type
- method
type: object
OnCallTrigger:
description: Trigger a workflow from an On-Call Page or On-Call Handover. For
automatic triggering a handle must be configured and the workflow must be
published.
properties:
rateLimit:
$ref: '#/components/schemas/TriggerRateLimit'
type: object
OnCallTriggerWrapper:
description: Schema for an On-Call-based trigger.
properties:
onCallTrigger:
$ref: '#/components/schemas/OnCallTrigger'
startStepNames:
$ref: '#/components/schemas/StartStepNames'
required:
- onCallTrigger
type: object
OnDemandConcurrencyCap:
description: On-demand concurrency cap.
properties:
Expand Down Expand Up @@ -60788,6 +60806,7 @@ components:
- $ref: '#/components/schemas/IncidentTriggerWrapper'
- $ref: '#/components/schemas/MonitorTriggerWrapper'
- $ref: '#/components/schemas/NotebookTriggerWrapper'
- $ref: '#/components/schemas/OnCallTriggerWrapper'
- $ref: '#/components/schemas/ScheduleTriggerWrapper'
- $ref: '#/components/schemas/SecurityTriggerWrapper'
- $ref: '#/components/schemas/SelfServiceTriggerWrapper'
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3529,6 +3529,8 @@ def overrides
"v2.on_call_page_target_type" => "OnCallPageTargetType",
"v2.on_call_phone_notification_rule_method" => "OnCallPhoneNotificationRuleMethod",
"v2.on_call_phone_notification_rule_settings" => "OnCallPhoneNotificationRuleSettings",
"v2.on_call_trigger" => "OnCallTrigger",
"v2.on_call_trigger_wrapper" => "OnCallTriggerWrapper",
"v2.on_demand_concurrency_cap" => "OnDemandConcurrencyCap",
"v2.on_demand_concurrency_cap_attributes" => "OnDemandConcurrencyCapAttributes",
"v2.on_demand_concurrency_cap_response" => "OnDemandConcurrencyCapResponse",
Expand Down
105 changes: 105 additions & 0 deletions lib/datadog_api_client/v2/models/on_call_trigger.rb
Original file line number Diff line number Diff line change
@@ -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
# Trigger a workflow from an On-Call Page or On-Call Handover. For automatic triggering a handle must be configured and the workflow must be published.
class OnCallTrigger
include BaseGenericModel

# Defines a rate limit for a trigger.
attr_accessor :rate_limit

attr_accessor :additional_properties

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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'rate_limit' => :'TriggerRateLimit'
}
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::OnCallTrigger` 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?(:'rate_limit')
self.rate_limit = attributes[:'rate_limit']
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 &&
rate_limit == o.rate_limit &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[rate_limit, additional_properties].hash
end
end
end
135 changes: 135 additions & 0 deletions lib/datadog_api_client/v2/models/on_call_trigger_wrapper.rb
Original file line number Diff line number Diff line change
@@ -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
# Schema for an On-Call-based trigger.
class OnCallTriggerWrapper
include BaseGenericModel

# Trigger a workflow from an On-Call Page or On-Call Handover. For automatic triggering a handle must be configured and the workflow must be published.
attr_reader :on_call_trigger

# A list of steps that run first after a trigger fires.
attr_accessor :start_step_names

attr_accessor :additional_properties

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

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'on_call_trigger' => :'OnCallTrigger',
:'start_step_names' => :'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::OnCallTriggerWrapper` 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?(:'on_call_trigger')
self.on_call_trigger = attributes[:'on_call_trigger']
end

if attributes.key?(:'start_step_names')
if (value = attributes[:'start_step_names']).is_a?(Array)
self.start_step_names = 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 @on_call_trigger.nil?
true
end

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

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[on_call_trigger, start_step_names, additional_properties].hash
end
end
end
1 change: 1 addition & 0 deletions lib/datadog_api_client/v2/models/trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def openapi_one_of
:'IncidentTriggerWrapper',
:'MonitorTriggerWrapper',
:'NotebookTriggerWrapper',
:'OnCallTriggerWrapper',
:'ScheduleTriggerWrapper',
:'SecurityTriggerWrapper',
:'SelfServiceTriggerWrapper',
Expand Down
Loading