diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e24a358f1bdc..3f6d911acd91 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -33708,10 +33708,27 @@ components: example: 3600 format: int64 type: integer + fail_on_no_data: + default: true + description: Whether the rule should fail if a matching monitor group is in a NO DATA state. + example: false + type: boolean + fail_on_no_groups_found: + default: false + description: Whether the rule should fail if no monitor groups are found for the query. + example: false + type: boolean query: description: Monitors that match this query are evaluated. example: "service:my-service env:prod" type: string + warmup: + default: 0 + description: Seconds to wait after a deployment starts before evaluating the monitor's status. + example: 0 + format: int64 + minimum: 0 + type: integer required: - query type: object diff --git a/lib/datadog_api_client/v2/models/deployment_rule_options_monitor.rb b/lib/datadog_api_client/v2/models/deployment_rule_options_monitor.rb index 88d945d165b1..64ee4e5d4a4f 100644 --- a/lib/datadog_api_client/v2/models/deployment_rule_options_monitor.rb +++ b/lib/datadog_api_client/v2/models/deployment_rule_options_monitor.rb @@ -24,15 +24,27 @@ class DeploymentRuleOptionsMonitor # Seconds the monitor needs to stay in OK status for the rule to pass. attr_accessor :duration + # Whether the rule should fail if a matching monitor group is in a NO DATA state. + attr_accessor :fail_on_no_data + + # Whether the rule should fail if no monitor groups are found for the query. + attr_accessor :fail_on_no_groups_found + # Monitors that match this query are evaluated. attr_reader :query + # Seconds to wait after a deployment starts before evaluating the monitor's status. + attr_reader :warmup + # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { :'duration' => :'duration', - :'query' => :'query' + :'fail_on_no_data' => :'fail_on_no_data', + :'fail_on_no_groups_found' => :'fail_on_no_groups_found', + :'query' => :'query', + :'warmup' => :'warmup' } end @@ -41,7 +53,10 @@ def self.attribute_map def self.openapi_types { :'duration' => :'Integer', - :'query' => :'String' + :'fail_on_no_data' => :'Boolean', + :'fail_on_no_groups_found' => :'Boolean', + :'query' => :'String', + :'warmup' => :'Integer' } end @@ -65,9 +80,21 @@ def initialize(attributes = {}) self.duration = attributes[:'duration'] end + if attributes.key?(:'fail_on_no_data') + self.fail_on_no_data = attributes[:'fail_on_no_data'] + end + + if attributes.key?(:'fail_on_no_groups_found') + self.fail_on_no_groups_found = attributes[:'fail_on_no_groups_found'] + end + if attributes.key?(:'query') self.query = attributes[:'query'] end + + if attributes.key?(:'warmup') + self.warmup = attributes[:'warmup'] + end end # Check to see if the all the properties in the model are valid @@ -75,6 +102,7 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @query.nil? + return false if !@warmup.nil? && @warmup < 0 true end @@ -88,6 +116,16 @@ def query=(query) @query = query end + # Custom attribute writer method with validation + # @param warmup [Object] Object to be assigned + # @!visibility private + def warmup=(warmup) + if !warmup.nil? && warmup < 0 + fail ArgumentError, 'invalid value for "warmup", must be greater than or equal to 0.' + end + @warmup = warmup + end + # Checks equality by comparing each attribute. # @param o [Object] Object to be compared # @!visibility private @@ -95,14 +133,17 @@ def ==(o) return true if self.equal?(o) self.class == o.class && duration == o.duration && - query == o.query + fail_on_no_data == o.fail_on_no_data && + fail_on_no_groups_found == o.fail_on_no_groups_found && + query == o.query && + warmup == o.warmup end # Calculates hash code according to all attributes. # @return [Integer] Hash code # @!visibility private def hash - [duration, query].hash + [duration, fail_on_no_data, fail_on_no_groups_found, query, warmup].hash end end end