=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 service level objective object includes a service level indicator, thresholds # for one or more timeframes, and metadata (`name`, `description`, and `tags`). class SearchServiceLevelObjectiveAttributes include BaseGenericModel # A list of tags associated with this service level objective. # Always included in service level objective responses (but may be empty). attr_accessor :all_tags # Creation timestamp (UNIX time in seconds) # # Always included in service level objective responses. attr_accessor :created_at # The creator of the SLO attr_accessor :creator # A user-defined description of the service level objective. # # Always included in service level objective responses (but may be `null`). # Optional in create/update requests. attr_accessor :description # Tags with the `env` tag key. attr_accessor :env_tags # A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. # Included in service level objective responses if it is not empty. attr_accessor :groups # Modification timestamp (UNIX time in seconds) # # Always included in service level objective responses. attr_accessor :modified_at # A list of monitor ids that defines the scope of a monitor service level # objective. attr_accessor :monitor_ids # The name of the service level objective object. attr_accessor :name # calculated status and error budget remaining. attr_accessor :overall_status # A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator # to be used because this will sum up all request counts instead of averaging them, or taking the max or # min of all of those requests. attr_accessor :query # Tags with the `service` tag key. attr_accessor :service_tags # The type of the service level objective. attr_accessor :slo_type # Status of the SLO's primary timeframe. attr_accessor :status # Tags with the `team` tag key. attr_accessor :team_tags # The thresholds (timeframes and associated targets) for this service level # objective object. attr_accessor :thresholds # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { :'all_tags' => :'all_tags', :'created_at' => :'created_at', :'creator' => :'creator', :'description' => :'description', :'env_tags' => :'env_tags', :'groups' => :'groups', :'modified_at' => :'modified_at', :'monitor_ids' => :'monitor_ids', :'name' => :'name', :'overall_status' => :'overall_status', :'query' => :'query', :'service_tags' => :'service_tags', :'slo_type' => :'slo_type', :'status' => :'status', :'team_tags' => :'team_tags', :'thresholds' => :'thresholds' } end # Attribute type mapping. # @!visibility private def self.openapi_types { :'all_tags' => :'Array', :'created_at' => :'Integer', :'creator' => :'SLOCreator', :'description' => :'String', :'env_tags' => :'Array', :'groups' => :'Array', :'modified_at' => :'Integer', :'monitor_ids' => :'Array', :'name' => :'String', :'overall_status' => :'Array', :'query' => :'SearchSLOQuery', :'service_tags' => :'Array', :'slo_type' => :'SLOType', :'status' => :'SLOStatus', :'team_tags' => :'Array', :'thresholds' => :'Array' } end # List of attributes with nullable: true # @!visibility private def self.openapi_nullable Set.new([ :'creator', :'description', :'groups', :'monitor_ids', :'query', ]) 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::SearchServiceLevelObjectiveAttributes` 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::SearchServiceLevelObjectiveAttributes`. 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?(:'all_tags') if (value = attributes[:'all_tags']).is_a?(Array) self.all_tags = value end end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'creator') self.creator = attributes[:'creator'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'env_tags') if (value = attributes[:'env_tags']).is_a?(Array) self.env_tags = value end end if attributes.key?(:'groups') if (value = attributes[:'groups']).is_a?(Array) self.groups = value end end if attributes.key?(:'modified_at') self.modified_at = attributes[:'modified_at'] end if attributes.key?(:'monitor_ids') if (value = attributes[:'monitor_ids']).is_a?(Array) self.monitor_ids = value end end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'overall_status') if (value = attributes[:'overall_status']).is_a?(Array) self.overall_status = value end end if attributes.key?(:'query') self.query = attributes[:'query'] end if attributes.key?(:'service_tags') if (value = attributes[:'service_tags']).is_a?(Array) self.service_tags = value end end if attributes.key?(:'slo_type') self.slo_type = attributes[:'slo_type'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'team_tags') if (value = attributes[:'team_tags']).is_a?(Array) self.team_tags = value end end if attributes.key?(:'thresholds') if (value = attributes[:'thresholds']).is_a?(Array) self.thresholds = value end end 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 && all_tags == o.all_tags && created_at == o.created_at && creator == o.creator && description == o.description && env_tags == o.env_tags && groups == o.groups && modified_at == o.modified_at && monitor_ids == o.monitor_ids && name == o.name && overall_status == o.overall_status && query == o.query && service_tags == o.service_tags && slo_type == o.slo_type && status == o.status && team_tags == o.team_tags && thresholds == o.thresholds end # Calculates hash code according to all attributes. # @return [Integer] Hash code # @!visibility private def hash [all_tags, created_at, creator, description, env_tags, groups, modified_at, monitor_ids, name, overall_status, query, service_tags, slo_type, status, team_tags, thresholds].hash end end end