From 009ec6d61513901c933df99b14a8c039d4ecc8a1 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 3 Apr 2024 15:02:31 +0000 Subject: [PATCH] Regenerate client from commit e8144990 of spec repo --- .apigentools-info | 8 ++--- .generator/schemas/v1/openapi.yaml | 21 +++++++++++++- lib/datadog_api_client/inflector.rb | 1 + .../v1/models/slo_time_slice_condition.rb | 16 ++++++++-- .../v1/models/slo_time_slice_interval.rb | 29 +++++++++++++++++++ .../v1/models/slo_time_slice_spec.rb | 2 +- 6 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 lib/datadog_api_client/v1/models/slo_time_slice_interval.rb diff --git a/.apigentools-info b/.apigentools-info index 0267361ccb04..a42e0fdddc13 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-04-02 13:17:38.209256", - "spec_repo_commit": "de9967cc" + "regenerated": "2024-04-03 15:02:06.639007", + "spec_repo_commit": "e8144990" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-04-02 13:17:38.259818", - "spec_repo_commit": "de9967cc" + "regenerated": "2024-04-03 15:02:06.656114", + "spec_repo_commit": "e8144990" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index d1e645a4da80..6fa32ee0121a 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -11370,7 +11370,8 @@ components: description: 'The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator, - and 3. the threshold.' + and 3. the threshold. Optionally, a fourth part, the query interval, can be + provided.' example: comparator: < query: @@ -11389,6 +11390,8 @@ components: $ref: '#/components/schemas/SLOTimeSliceComparator' query: $ref: '#/components/schemas/SLOTimeSliceQuery' + query_interval_seconds: + $ref: '#/components/schemas/SLOTimeSliceInterval' threshold: description: The threshold value to which each SLI value will be compared. example: 5 @@ -11399,6 +11402,22 @@ components: - threshold - query type: object + SLOTimeSliceInterval: + description: 'The interval used when querying data, which defines the size of + a time slice. + + Two values are allowed: 60 (1 minute) and 300 (5 minutes). + + If not provided, the value defaults to 300 (5 minutes).' + enum: + - 60 + - 300 + example: 300 + format: int32 + type: integer + x-enum-varnames: + - ONE_MINUTE + - FIVE_MINUTES SLOTimeSliceQuery: description: The queries and formula used to calculate the SLI value. example: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 84f1d628abbd..60a0c41b15d3 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -508,6 +508,7 @@ def overrides "v1.slo_timeframe" => "SLOTimeframe", "v1.slo_time_slice_comparator" => "SLOTimeSliceComparator", "v1.slo_time_slice_condition" => "SLOTimeSliceCondition", + "v1.slo_time_slice_interval" => "SLOTimeSliceInterval", "v1.slo_time_slice_query" => "SLOTimeSliceQuery", "v1.slo_time_slice_spec" => "SLOTimeSliceSpec", "v1.slo_type" => "SLOType", diff --git a/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb b/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb index cc8694fdbf53..80928f9aad42 100644 --- a/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb +++ b/lib/datadog_api_client/v1/models/slo_time_slice_condition.rb @@ -18,7 +18,7 @@ module DatadogAPIClient::V1 # The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator, - # and 3. the threshold. + # and 3. the threshold. Optionally, a fourth part, the query interval, can be provided. class SLOTimeSliceCondition include BaseGenericModel @@ -28,6 +28,11 @@ class SLOTimeSliceCondition # The queries and formula used to calculate the SLI value. attr_reader :query + # The interval used when querying data, which defines the size of a time slice. + # Two values are allowed: 60 (1 minute) and 300 (5 minutes). + # If not provided, the value defaults to 300 (5 minutes). + attr_accessor :query_interval_seconds + # The threshold value to which each SLI value will be compared. attr_reader :threshold @@ -37,6 +42,7 @@ def self.attribute_map { :'comparator' => :'comparator', :'query' => :'query', + :'query_interval_seconds' => :'query_interval_seconds', :'threshold' => :'threshold' } end @@ -47,6 +53,7 @@ def self.openapi_types { :'comparator' => :'SLOTimeSliceComparator', :'query' => :'SLOTimeSliceQuery', + :'query_interval_seconds' => :'SLOTimeSliceInterval', :'threshold' => :'Float' } end @@ -75,6 +82,10 @@ def initialize(attributes = {}) self.query = attributes[:'query'] end + if attributes.key?(:'query_interval_seconds') + self.query_interval_seconds = attributes[:'query_interval_seconds'] + end + if attributes.key?(:'threshold') self.threshold = attributes[:'threshold'] end @@ -128,6 +139,7 @@ def ==(o) self.class == o.class && comparator == o.comparator && query == o.query && + query_interval_seconds == o.query_interval_seconds && threshold == o.threshold end @@ -135,7 +147,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [comparator, query, threshold].hash + [comparator, query, query_interval_seconds, threshold].hash end end end diff --git a/lib/datadog_api_client/v1/models/slo_time_slice_interval.rb b/lib/datadog_api_client/v1/models/slo_time_slice_interval.rb new file mode 100644 index 000000000000..304d48896ab6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/slo_time_slice_interval.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V1 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::V1 + # The interval used when querying data, which defines the size of a time slice. + # Two values are allowed: 60 (1 minute) and 300 (5 minutes). + # If not provided, the value defaults to 300 (5 minutes). + class SLOTimeSliceInterval + include BaseEnumModel + + ONE_MINUTE = 60.freeze + FIVE_MINUTES = 300.freeze + end +end diff --git a/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb b/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb index 6cb1eddbd988..1355b07874e4 100644 --- a/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb +++ b/lib/datadog_api_client/v1/models/slo_time_slice_spec.rb @@ -22,7 +22,7 @@ class SLOTimeSliceSpec include BaseGenericModel # The time-slice condition, composed of 3 parts: 1. the metric timeseries query, 2. the comparator, - # and 3. the threshold. + # and 3. the threshold. Optionally, a fourth part, the query interval, can be provided. attr_reader :time_slice # Attribute mapping from ruby-style variable name to JSON key.