diff --git a/.apigentools-info b/.apigentools-info index e8589c450057..601af9027a79 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-17 14:44:35.705822", - "spec_repo_commit": "f8bfb8c1" + "regenerated": "2023-05-17 20:58:05.065018", + "spec_repo_commit": "d8186149" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-17 14:44:35.718657", - "spec_repo_commit": "f8bfb8c1" + "regenerated": "2023-05-17 20:58:05.077115", + "spec_repo_commit": "d8186149" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3c8bef220394..e7988d6e5eef 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2728,6 +2728,7 @@ components: - $ref: '#/components/schemas/FormulaAndFunctionProcessQueryDefinition' - $ref: '#/components/schemas/FormulaAndFunctionApmDependencyStatsQueryDefinition' - $ref: '#/components/schemas/FormulaAndFunctionApmResourceStatsQueryDefinition' + - $ref: '#/components/schemas/FormulaAndFunctionSLOQueryDefinition' type: object FormulaAndFunctionResponseFormat: description: Timeseries or Scalar response. @@ -2739,6 +2740,81 @@ components: x-enum-varnames: - TIMESERIES - SCALAR + FormulaAndFunctionSLODataSource: + description: Data source for SLO measures queries. + enum: + - slo + example: slo + type: string + x-enum-varnames: + - SLO + FormulaAndFunctionSLOGroupMode: + description: Group mode to query measures. + enum: + - overall + - components + example: overall + type: string + x-enum-varnames: + - OVERALL + - COMPONENTS + FormulaAndFunctionSLOMeasure: + description: SLO measures queries. + enum: + - good_events + - bad_events + - slo_status + - error_budget_remaining + - burn_rate + - error_budget_burndown + example: slo_status + type: string + x-enum-varnames: + - GOOD_EVENTS + - BAD_EVENTS + - SLO_STATUS + - ERROR_BUDGET_REMAINING + - BURN_RATE + - ERROR_BUDGET_BURNDOWN + FormulaAndFunctionSLOQueryDefinition: + description: A formula and functions metrics query. + example: + data_source: slo + group_mode: overall + measure: good_events + name: my_slo + slo_id: '12345678910' + slo_query_type: metric + properties: + data_source: + $ref: '#/components/schemas/FormulaAndFunctionSLODataSource' + group_mode: + $ref: '#/components/schemas/FormulaAndFunctionSLOGroupMode' + measure: + $ref: '#/components/schemas/FormulaAndFunctionSLOMeasure' + name: + description: Name of the query for use in formulas. + example: my_slo + type: string + slo_id: + description: ID of an SLO to query measures. + example: '12345678910' + type: string + slo_query_type: + $ref: '#/components/schemas/FormulaAndFunctionSLOQueryType' + required: + - data_source + - slo_id + - measure + type: object + FormulaAndFunctionSLOQueryType: + description: Name of the query for use in formulas. + enum: + - metric + example: metric + type: string + x-enum-varnames: + - METRIC FreeTextWidgetDefinition: description: Free text is a widget that allows you to add headings to your screenboard. Commonly used to state the overall purpose of the dashboard. Only available diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-a-change-widget-using-formulas-and-functions-slo-query.frozen b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-a-change-widget-using-formulas-and-functions-slo-query.frozen new file mode 100644 index 000000000000..8ebe85edb586 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-a-change-widget-using-formulas-and-functions-slo-query.frozen @@ -0,0 +1 @@ +2023-05-16T22:06:53.853Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-a-change-widget-using-formulas-and-functions-slo-query.yml b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-a-change-widget-using-formulas-and-functions-slo-query.yml new file mode 100644 index 000000000000..16ae010cfadf --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-new-dashboard-with-a-change-widget-using-formulas-and-functions-slo-query.yml @@ -0,0 +1,90 @@ +http_interactions: +- recorded_at: Tue, 16 May 2023 22:06:53 GMT + request: + body: + encoding: UTF-8 + string: '{"name":"Test-Create_a_new_dashboard_with_a_change_widget_using_formulas_and_functions_slo_query-1684274813","query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"thresholds":[{"target":95,"timeframe":"7d","warning":98}],"type":"metric"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/slo + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"1c7cc520f98356d6b79adb1f8dbdef60","name":"Test-Create_a_new_dashboard_with_a_change_widget_using_formulas_and_functions_slo_query-1684274813","tags":[],"monitor_tags":[],"thresholds":[{"timeframe":"7d","target":95.0,"target_display":"95.","warning":98.0,"warning_display":"98."}],"type":"metric","type_id":1,"description":"","timeframe":"7d","warning_threshold":98,"target_threshold":95,"query":{"denominator":"sum:httpservice.hits{!code:3xx}.as_count()","numerator":"sum:httpservice.hits{code:2xx}.as_count()"},"creator":{"name":null,"handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"created_at":1684274814,"modified_at":1684274814}],"error":null} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 May 2023 22:06:53 GMT + request: + body: + encoding: UTF-8 + string: '{"layout_type":"ordered","title":"Test-Create_a_new_dashboard_with_a_change_widget_using_formulas_and_functions_slo_query-1684274813","widgets":[{"definition":{"requests":[{"change_type":"absolute","formulas":[{"formula":"hour_before(query1)"},{"formula":"query1"}],"increase_good":true,"order_by":"change","order_dir":"asc","queries":[{"data_source":"slo","group_mode":"overall","measure":"slo_status","name":"query1","slo_id":"1c7cc520f98356d6b79adb1f8dbdef60","slo_query_type":"metric"}],"response_format":"scalar"}],"time":{},"title":"","title_align":"left","title_size":"16","type":"change"},"layout":{"height":2,"width":4,"x":0,"y":0}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"id":"8kt-y74-2i3","title":"Test-Create_a_new_dashboard_with_a_change_widget_using_formulas_and_functions_slo_query-1684274813","description":null,"author_handle":"frog@datadoghq.com","author_name":null,"layout_type":"ordered","url":"/dashboard/8kt-y74-2i3/test-createanewdashboardwithachangewidgetusingformulasandfunctionssloquery-16842","is_read_only":false,"template_variables":null,"widgets":[{"definition":{"requests":[{"change_type":"absolute","formulas":[{"formula":"hour_before(query1)"},{"formula":"query1"}],"increase_good":true,"order_by":"change","order_dir":"asc","queries":[{"data_source":"slo","group_mode":"overall","measure":"slo_status","name":"query1","slo_id":"1c7cc520f98356d6b79adb1f8dbdef60","slo_query_type":"metric"}],"response_format":"scalar"}],"time":{},"title":"","title_align":"left","title_size":"16","type":"change"},"layout":{"height":2,"width":4,"x":0,"y":0},"id":8047848064178828}],"notify_list":null,"created_at":"2023-05-16T22:06:54.344881+00:00","modified_at":"2023-05-16T22:06:54.344881+00:00","restricted_roles":[]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 May 2023 22:06:53 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/8kt-y74-2i3 + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"8kt-y74-2i3"} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 May 2023 22:06:53 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/slo/1c7cc520f98356d6b79adb1f8dbdef60 + response: + body: + encoding: UTF-8 + string: '{"data":["1c7cc520f98356d6b79adb1f8dbdef60"],"error":null} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_3562282606.rb b/examples/v1/dashboards/CreateDashboard_3562282606.rb new file mode 100644 index 000000000000..5e8824ee9356 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_3562282606.rb @@ -0,0 +1,57 @@ +# Create a new dashboard with a change widget using formulas and functions slo query + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +# there is a valid "slo" in the system +SLO_DATA_0_ID = ENV["SLO_DATA_0_ID"] + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + definition: DatadogAPIClient::V1::ChangeWidgetDefinition.new({ + title: "", + title_size: "16", + title_align: DatadogAPIClient::V1::WidgetTextAlign::LEFT, + time: DatadogAPIClient::V1::WidgetTime.new({}), + type: DatadogAPIClient::V1::ChangeWidgetDefinitionType::CHANGE, + requests: [ + DatadogAPIClient::V1::ChangeWidgetRequest.new({ + formulas: [ + DatadogAPIClient::V1::WidgetFormula.new({ + formula: "hour_before(query1)", + }), + DatadogAPIClient::V1::WidgetFormula.new({ + formula: "query1", + }), + ], + queries: [ + DatadogAPIClient::V1::FormulaAndFunctionSLOQueryDefinition.new({ + name: "query1", + data_source: DatadogAPIClient::V1::FormulaAndFunctionSLODataSource::SLO, + slo_id: SLO_DATA_0_ID, + measure: DatadogAPIClient::V1::FormulaAndFunctionSLOMeasure::SLO_STATUS, + group_mode: DatadogAPIClient::V1::FormulaAndFunctionSLOGroupMode::OVERALL, + slo_query_type: DatadogAPIClient::V1::FormulaAndFunctionSLOQueryType::METRIC, + }), + ], + response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR, + order_by: DatadogAPIClient::V1::WidgetOrderBy::CHANGE, + change_type: DatadogAPIClient::V1::WidgetChangeType::ABSOLUTE, + increase_good: true, + order_dir: DatadogAPIClient::V1::WidgetSort::ASCENDING, + }), + ], + }), + layout: DatadogAPIClient::V1::WidgetLayout.new({ + x: 0, + y: 0, + width: 4, + height: 2, + }), + }), + ], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index b417bf5e7386..80602421b550 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -72,6 +72,27 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].profile_metrics_query.compute.facet" is equal to "@prof_core_cpu_cores" And the response "widgets[0].definition.requests[0].profile_metrics_query.compute.aggregation" is equal to "sum" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with a change widget using formulas and functions slo query + Given there is a valid "slo" in the system + And new "CreateDashboard" request + And body with value { "title": "{{ unique }}", "widgets": [ { "definition": {"title": "", "title_size": "16", "title_align": "left", "time": {}, "type": "change", "requests": [ {"formulas": [ { "formula": "hour_before(query1)" }, { "formula": "query1" } ], "queries": [ {"name": "query1", "data_source": "slo", "slo_id": "{{ slo.data[0].id }}", "measure": "slo_status", "group_mode": "overall", "slo_query_type": "metric" } ], "response_format": "scalar", "order_by": "change", "change_type": "absolute", "increase_good": true, "order_dir": "asc" } ] }, "layout": { "x":0, "y": 0, "width": 4, "height": 2 } } ], "layout_type": "ordered" } + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.requests[0].response_format" is equal to "scalar" + And the response "widgets[0].definition.requests[0].increase_good" is equal to true + And the response "widgets[0].definition.requests[0].order_by" is equal to "change" + And the response "widgets[0].definition.requests[0].change_type" is equal to "absolute" + And the response "widgets[0].definition.requests[0].order_dir" is equal to "asc" + And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "slo" + And the response "widgets[0].definition.requests[0].queries[0].name" is equal to "query1" + And the response "widgets[0].definition.requests[0].queries[0].group_mode" is equal to "overall" + And the response "widgets[0].definition.requests[0].queries[0].measure" is equal to "slo_status" + And the response "widgets[0].definition.requests[0].queries[0].slo_query_type" is equal to "metric" + And the response "widgets[0].definition.requests[0].queries[0].slo_id" has the same value as "slo.data[0].id" + And the response "widgets[0].definition.requests[0].formulas[0].formula" is equal to "hour_before(query1)" + And the response "widgets[0].definition.requests[0].formulas[1].formula" is equal to "query1" + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with a formulas and functions change widget Given new "CreateDashboard" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e151611caacd..c82dbc5891bb 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -127,6 +127,11 @@ def overrides "v1.formula_and_function_process_query_definition" => "FormulaAndFunctionProcessQueryDefinition", "v1.formula_and_function_query_definition" => "FormulaAndFunctionQueryDefinition", "v1.formula_and_function_response_format" => "FormulaAndFunctionResponseFormat", + "v1.formula_and_function_slo_data_source" => "FormulaAndFunctionSLODataSource", + "v1.formula_and_function_slo_group_mode" => "FormulaAndFunctionSLOGroupMode", + "v1.formula_and_function_slo_measure" => "FormulaAndFunctionSLOMeasure", + "v1.formula_and_function_slo_query_definition" => "FormulaAndFunctionSLOQueryDefinition", + "v1.formula_and_function_slo_query_type" => "FormulaAndFunctionSLOQueryType", "v1.free_text_widget_definition" => "FreeTextWidgetDefinition", "v1.free_text_widget_definition_type" => "FreeTextWidgetDefinitionType", "v1.funnel_query" => "FunnelQuery", diff --git a/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb b/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb index 84b9f9020c4c..02d6a67f1268 100644 --- a/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb +++ b/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb @@ -30,7 +30,8 @@ def openapi_one_of :'FormulaAndFunctionEventQueryDefinition', :'FormulaAndFunctionProcessQueryDefinition', :'FormulaAndFunctionApmDependencyStatsQueryDefinition', - :'FormulaAndFunctionApmResourceStatsQueryDefinition' + :'FormulaAndFunctionApmResourceStatsQueryDefinition', + :'FormulaAndFunctionSLOQueryDefinition' ] end # Builds the object diff --git a/lib/datadog_api_client/v1/models/formula_and_function_slo_data_source.rb b/lib/datadog_api_client/v1/models/formula_and_function_slo_data_source.rb new file mode 100644 index 000000000000..7161e9482f88 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_slo_data_source.rb @@ -0,0 +1,26 @@ +=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 + # Data source for SLO measures queries. + class FormulaAndFunctionSLODataSource + include BaseEnumModel + + SLO = "slo".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_slo_group_mode.rb b/lib/datadog_api_client/v1/models/formula_and_function_slo_group_mode.rb new file mode 100644 index 000000000000..bd3d60f2c09e --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_slo_group_mode.rb @@ -0,0 +1,27 @@ +=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 + # Group mode to query measures. + class FormulaAndFunctionSLOGroupMode + include BaseEnumModel + + OVERALL = "overall".freeze + COMPONENTS = "components".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_slo_measure.rb b/lib/datadog_api_client/v1/models/formula_and_function_slo_measure.rb new file mode 100644 index 000000000000..92441c69ec41 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_slo_measure.rb @@ -0,0 +1,31 @@ +=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 + # SLO measures queries. + class FormulaAndFunctionSLOMeasure + include BaseEnumModel + + GOOD_EVENTS = "good_events".freeze + BAD_EVENTS = "bad_events".freeze + SLO_STATUS = "slo_status".freeze + ERROR_BUDGET_REMAINING = "error_budget_remaining".freeze + BURN_RATE = "burn_rate".freeze + ERROR_BUDGET_BURNDOWN = "error_budget_burndown".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb b/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb new file mode 100644 index 000000000000..8becc8524281 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_slo_query_definition.rb @@ -0,0 +1,174 @@ +=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 + # A formula and functions metrics query. + class FormulaAndFunctionSLOQueryDefinition + include BaseGenericModel + + # Whether the object has unparsed attributes + # @!visibility private + attr_accessor :_unparsed + + # Data source for SLO measures queries. + attr_reader :data_source + + # Group mode to query measures. + attr_accessor :group_mode + + # SLO measures queries. + attr_reader :measure + + # Name of the query for use in formulas. + attr_accessor :name + + # ID of an SLO to query measures. + attr_reader :slo_id + + # Name of the query for use in formulas. + attr_accessor :slo_query_type + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_source' => :'data_source', + :'group_mode' => :'group_mode', + :'measure' => :'measure', + :'name' => :'name', + :'slo_id' => :'slo_id', + :'slo_query_type' => :'slo_query_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_source' => :'FormulaAndFunctionSLODataSource', + :'group_mode' => :'FormulaAndFunctionSLOGroupMode', + :'measure' => :'FormulaAndFunctionSLOMeasure', + :'name' => :'String', + :'slo_id' => :'String', + :'slo_query_type' => :'FormulaAndFunctionSLOQueryType' + } + 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::V1::FormulaAndFunctionSLOQueryDefinition` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::FormulaAndFunctionSLOQueryDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'group_mode') + self.group_mode = attributes[:'group_mode'] + end + + if attributes.key?(:'measure') + self.measure = attributes[:'measure'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'slo_id') + self.slo_id = attributes[:'slo_id'] + end + + if attributes.key?(:'slo_query_type') + self.slo_query_type = attributes[:'slo_query_type'] + 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 @data_source.nil? + return false if @measure.nil? + return false if @slo_id.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param measure [Object] Object to be assigned + # @!visibility private + def measure=(measure) + if measure.nil? + fail ArgumentError, 'invalid value for "measure", measure cannot be nil.' + end + @measure = measure + end + + # Custom attribute writer method with validation + # @param slo_id [Object] Object to be assigned + # @!visibility private + def slo_id=(slo_id) + if slo_id.nil? + fail ArgumentError, 'invalid value for "slo_id", slo_id cannot be nil.' + end + @slo_id = slo_id + 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 && + data_source == o.data_source && + group_mode == o.group_mode && + measure == o.measure && + name == o.name && + slo_id == o.slo_id && + slo_query_type == o.slo_query_type + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_source, group_mode, measure, name, slo_id, slo_query_type].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_slo_query_type.rb b/lib/datadog_api_client/v1/models/formula_and_function_slo_query_type.rb new file mode 100644 index 000000000000..87e614877a99 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_slo_query_type.rb @@ -0,0 +1,26 @@ +=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 + # Name of the query for use in formulas. + class FormulaAndFunctionSLOQueryType + include BaseEnumModel + + METRIC = "metric".freeze + end +end