=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 # Team attributes. class AuthNMappingTeamAttributes include BaseGenericModel # Unicode representation of the avatar for the team, limited to a single grapheme attr_accessor :avatar # Banner selection for the team attr_accessor :banner # The team's identifier attr_reader :handle # The number of links belonging to the team attr_reader :link_count # The name of the team attr_reader :name # A brief summary of the team, derived from the `description` attr_reader :summary # The number of users belonging to the team attr_reader :user_count attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. # @!visibility private def self.attribute_map { :'avatar' => :'avatar', :'banner' => :'banner', :'handle' => :'handle', :'link_count' => :'link_count', :'name' => :'name', :'summary' => :'summary', :'user_count' => :'user_count' } end # Attribute type mapping. # @!visibility private def self.openapi_types { :'avatar' => :'String', :'banner' => :'Integer', :'handle' => :'String', :'link_count' => :'Integer', :'name' => :'String', :'summary' => :'String', :'user_count' => :'Integer' } end # List of attributes with nullable: true # @!visibility private def self.openapi_nullable Set.new([ :'avatar', :'banner', :'summary', ]) 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::AuthNMappingTeamAttributes` initialize method" end self.additional_properties = {} # 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)) self.additional_properties[k.to_sym] = v else h[k.to_sym] = v end } if attributes.key?(:'avatar') self.avatar = attributes[:'avatar'] end if attributes.key?(:'banner') self.banner = attributes[:'banner'] end if attributes.key?(:'handle') self.handle = attributes[:'handle'] end if attributes.key?(:'link_count') self.link_count = attributes[:'link_count'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'summary') self.summary = attributes[:'summary'] end if attributes.key?(:'user_count') self.user_count = attributes[:'user_count'] 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 !@handle.nil? && @handle.to_s.length > 195 return false if !@link_count.nil? && @link_count > 2147483647 return false if !@name.nil? && @name.to_s.length > 200 return false if !@summary.nil? && @summary.to_s.length > 120 return false if !@user_count.nil? && @user_count > 2147483647 true end # Custom attribute writer method with validation # @param handle [Object] Object to be assigned # @!visibility private def handle=(handle) if !handle.nil? && handle.to_s.length > 195 fail ArgumentError, 'invalid value for "handle", the character length must be smaller than or equal to 195.' end @handle = handle end # Custom attribute writer method with validation # @param link_count [Object] Object to be assigned # @!visibility private def link_count=(link_count) if !link_count.nil? && link_count > 2147483647 fail ArgumentError, 'invalid value for "link_count", must be smaller than or equal to 2147483647.' end @link_count = link_count end # Custom attribute writer method with validation # @param name [Object] Object to be assigned # @!visibility private def name=(name) if !name.nil? && name.to_s.length > 200 fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.' end @name = name end # Custom attribute writer method with validation # @param summary [Object] Object to be assigned # @!visibility private def summary=(summary) if !summary.nil? && summary.to_s.length > 120 fail ArgumentError, 'invalid value for "summary", the character length must be smaller than or equal to 120.' end @summary = summary end # Custom attribute writer method with validation # @param user_count [Object] Object to be assigned # @!visibility private def user_count=(user_count) if !user_count.nil? && user_count > 2147483647 fail ArgumentError, 'invalid value for "user_count", must be smaller than or equal to 2147483647.' end @user_count = user_count end # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end self.additional_properties.each_pair do |attr, value| hash[attr] = value end hash 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 && avatar == o.avatar && banner == o.banner && handle == o.handle && link_count == o.link_count && name == o.name && summary == o.summary && user_count == o.user_count additional_properties == o.additional_properties end # Calculates hash code according to all attributes. # @return [Integer] Hash code # @!visibility private def hash [avatar, banner, handle, link_count, name, summary, user_count].hash end end end