=begin #Datadog API V2 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::V2 # A dashboard within a list. class DashboardListItem include BaseGenericModel # Whether the object has unparsed attributes # @!visibility private attr_accessor :_unparsed # Creator of the object. attr_accessor :author # Date of creation of the dashboard. attr_accessor :created # URL to the icon of the dashboard. attr_accessor :icon # ID of the dashboard. attr_reader :id # Whether or not the dashboard is in the favorites. attr_accessor :is_favorite # Whether or not the dashboard is read only. attr_accessor :is_read_only # Whether the dashboard is publicly shared or not. attr_accessor :is_shared # Date of last edition of the dashboard. attr_accessor :modified # Popularity of the dashboard. attr_reader :popularity # Title of the dashboard. attr_accessor :title # The type of the dashboard. attr_reader :type # URL path to the dashboard. attr_accessor :url # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { :'author' => :'author', :'created' => :'created', :'icon' => :'icon', :'id' => :'id', :'is_favorite' => :'is_favorite', :'is_read_only' => :'is_read_only', :'is_shared' => :'is_shared', :'modified' => :'modified', :'popularity' => :'popularity', :'title' => :'title', :'type' => :'type', :'url' => :'url' } end # Attribute type mapping. # @!visibility private def self.openapi_types { :'author' => :'Creator', :'created' => :'Time', :'icon' => :'String', :'id' => :'String', :'is_favorite' => :'Boolean', :'is_read_only' => :'Boolean', :'is_shared' => :'Boolean', :'modified' => :'Time', :'popularity' => :'Integer', :'title' => :'String', :'type' => :'DashboardType', :'url' => :'String' } 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::V2::DashboardListItem` 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::V2::DashboardListItem`. 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?(:'author') self.author = attributes[:'author'] end if attributes.key?(:'created') self.created = attributes[:'created'] end if attributes.key?(:'icon') self.icon = attributes[:'icon'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'is_favorite') self.is_favorite = attributes[:'is_favorite'] end if attributes.key?(:'is_read_only') self.is_read_only = attributes[:'is_read_only'] end if attributes.key?(:'is_shared') self.is_shared = attributes[:'is_shared'] end if attributes.key?(:'modified') self.modified = attributes[:'modified'] end if attributes.key?(:'popularity') self.popularity = attributes[:'popularity'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'url') self.url = attributes[:'url'] 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 @id.nil? return false if !@popularity.nil? && @popularity > 5 return false if @type.nil? true end # Custom attribute writer method with validation # @param id [Object] Object to be assigned # @!visibility private def id=(id) if id.nil? fail ArgumentError, 'invalid value for "id", id cannot be nil.' end @id = id end # Custom attribute writer method with validation # @param popularity [Object] Object to be assigned # @!visibility private def popularity=(popularity) if !popularity.nil? && popularity > 5 fail ArgumentError, 'invalid value for "popularity", must be smaller than or equal to 5.' end @popularity = popularity end # Custom attribute writer method with validation # @param type [Object] Object to be assigned # @!visibility private def type=(type) if type.nil? fail ArgumentError, 'invalid value for "type", type cannot be nil.' end @type = type 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 && author == o.author && created == o.created && icon == o.icon && id == o.id && is_favorite == o.is_favorite && is_read_only == o.is_read_only && is_shared == o.is_shared && modified == o.modified && popularity == o.popularity && title == o.title && type == o.type && url == o.url end # Calculates hash code according to all attributes. # @return [Integer] Hash code # @!visibility private def hash [author, created, icon, id, is_favorite, is_read_only, is_shared, modified, popularity, title, type, url].hash end end end