=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 # An array of service level objective objects. class SLOHistoryResponseData include BaseGenericModel # Whether the object has unparsed attributes # @!visibility private attr_accessor :_unparsed # The `from` timestamp in epoch seconds. attr_accessor :from_ts # For `metric` based SLOs where the query includes a group-by clause, this represents the list of grouping parameters. # # This is not included in responses for `monitor` based SLOs. attr_accessor :group_by # For grouped SLOs, this represents SLI data for specific groups. # # This is not included in the responses for `metric` based SLOs. attr_accessor :groups # For multi-monitor SLOs, this represents SLI data for specific monitors. # # This is not included in the responses for `metric` based SLOs. attr_accessor :monitors # An object that holds an SLI value and its associated data. It can represent an SLO's overall SLI value. # This can also represent the SLI value for a specific monitor in multi-monitor SLOs, or a group in grouped SLOs. attr_accessor :overall # A `metric` based SLO history response. # # This is not included in responses for `monitor` based SLOs. attr_accessor :series # mapping of string timeframe to the SLO threshold. attr_accessor :thresholds # The `to` timestamp in epoch seconds. attr_accessor :to_ts # The type of the service level objective. attr_accessor :type # A numeric representation of the type of the service level objective (`0` for # monitor, `1` for metric). Always included in service level objective responses. # Ignored in create/update requests. attr_accessor :type_id # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { :'from_ts' => :'from_ts', :'group_by' => :'group_by', :'groups' => :'groups', :'monitors' => :'monitors', :'overall' => :'overall', :'series' => :'series', :'thresholds' => :'thresholds', :'to_ts' => :'to_ts', :'type' => :'type', :'type_id' => :'type_id' } end # Attribute type mapping. # @!visibility private def self.openapi_types { :'from_ts' => :'Integer', :'group_by' => :'Array', :'groups' => :'Array', :'monitors' => :'Array', :'overall' => :'SLOHistorySLIData', :'series' => :'SLOHistoryMetrics', :'thresholds' => :'Hash', :'to_ts' => :'Integer', :'type' => :'SLOType', :'type_id' => :'SLOTypeNumeric' } end # List of attributes with nullable: true # @!visibility private def self.openapi_nullable Set.new([ ]) 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::SLOHistoryResponseData` 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::SLOHistoryResponseData`. 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?(:'from_ts') self.from_ts = attributes[:'from_ts'] end if attributes.key?(:'group_by') if (value = attributes[:'group_by']).is_a?(Array) self.group_by = value end end if attributes.key?(:'groups') if (value = attributes[:'groups']).is_a?(Array) self.groups = value end end if attributes.key?(:'monitors') if (value = attributes[:'monitors']).is_a?(Array) self.monitors = value end end if attributes.key?(:'overall') self.overall = attributes[:'overall'] end if attributes.key?(:'series') self.series = attributes[:'series'] end if attributes.key?(:'thresholds') self.thresholds = attributes[:'thresholds'] end if attributes.key?(:'to_ts') self.to_ts = attributes[:'to_ts'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'type_id') self.type_id = attributes[:'type_id'] 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? true 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 && from_ts == o.from_ts && group_by == o.group_by && groups == o.groups && monitors == o.monitors && overall == o.overall && series == o.series && thresholds == o.thresholds && to_ts == o.to_ts && type == o.type && type_id == o.type_id end # Calculates hash code according to all attributes. # @return [Integer] Hash code # @!visibility private def hash [from_ts, group_by, groups, monitors, overall, series, thresholds, to_ts, type, type_id].hash end end end