=begin ARTIK Cloud API OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git License: MIT http://en.wikipedia.org/wiki/MIT_License Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html =end require 'date' module ArtikCloud # Device Type Information class DeviceType # Device Type ID. attr_accessor :id # Unique Name. attr_accessor :unique_name # Latest Manifest version. attr_accessor :latest_version attr_accessor :last_updated # Name. attr_accessor :name # Description. attr_accessor :description # User ID. attr_accessor :uid # Organization ID. attr_accessor :oid # Uses Cloud Connectors SDK attr_accessor :has_cloud_connector # Approval status. attr_accessor :approved # Published status. attr_accessor :published # Protected status. attr_accessor :protected # In Store. attr_accessor :in_store # Does the current user own a device of this device type attr_accessor :owned_by_current_user # Tags attr_accessor :tags # Require Secure Device Registration (SDR) Protocol. attr_accessor :rsp # Issuer Distinguished Name (Used in SDR) attr_accessor :issuer_dn # Vendor ID. (Used in SDR) attr_accessor :vid # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', :'unique_name' => :'uniqueName', :'latest_version' => :'latestVersion', :'last_updated' => :'lastUpdated', :'name' => :'name', :'description' => :'description', :'uid' => :'uid', :'oid' => :'oid', :'has_cloud_connector' => :'hasCloudConnector', :'approved' => :'approved', :'published' => :'published', :'protected' => :'protected', :'in_store' => :'inStore', :'owned_by_current_user' => :'ownedByCurrentUser', :'tags' => :'tags', :'rsp' => :'rsp', :'issuer_dn' => :'issuerDn', :'vid' => :'vid' } end # Attribute type mapping. def self.swagger_types { :'id' => :'String', :'unique_name' => :'String', :'latest_version' => :'Integer', :'last_updated' => :'Integer', :'name' => :'String', :'description' => :'String', :'uid' => :'String', :'oid' => :'String', :'has_cloud_connector' => :'BOOLEAN', :'approved' => :'BOOLEAN', :'published' => :'BOOLEAN', :'protected' => :'BOOLEAN', :'in_store' => :'BOOLEAN', :'owned_by_current_user' => :'BOOLEAN', :'tags' => :'Array', :'rsp' => :'BOOLEAN', :'issuer_dn' => :'String', :'vid' => :'String' } end def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} if attributes[:'id'] self.id = attributes[:'id'] end if attributes[:'uniqueName'] self.unique_name = attributes[:'uniqueName'] end if attributes[:'latestVersion'] self.latest_version = attributes[:'latestVersion'] end if attributes[:'lastUpdated'] self.last_updated = attributes[:'lastUpdated'] end if attributes[:'name'] self.name = attributes[:'name'] end if attributes[:'description'] self.description = attributes[:'description'] end if attributes[:'uid'] self.uid = attributes[:'uid'] end if attributes[:'oid'] self.oid = attributes[:'oid'] end if attributes[:'hasCloudConnector'] self.has_cloud_connector = attributes[:'hasCloudConnector'] end if attributes[:'approved'] self.approved = attributes[:'approved'] end if attributes[:'published'] self.published = attributes[:'published'] end if attributes[:'protected'] self.protected = attributes[:'protected'] end if attributes[:'inStore'] self.in_store = attributes[:'inStore'] end if attributes[:'ownedByCurrentUser'] self.owned_by_current_user = attributes[:'ownedByCurrentUser'] end if attributes[:'tags'] if (value = attributes[:'tags']).is_a?(Array) self.tags = value end end if attributes[:'rsp'] self.rsp = attributes[:'rsp'] end if attributes[:'issuerDn'] self.issuer_dn = attributes[:'issuerDn'] end if attributes[:'vid'] self.vid = attributes[:'vid'] end end # Check equality by comparing each attribute. def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && unique_name == o.unique_name && latest_version == o.latest_version && last_updated == o.last_updated && name == o.name && description == o.description && uid == o.uid && oid == o.oid && has_cloud_connector == o.has_cloud_connector && approved == o.approved && published == o.published && protected == o.protected && in_store == o.in_store && owned_by_current_user == o.owned_by_current_user && tags == o.tags && rsp == o.rsp && issuer_dn == o.issuer_dn && vid == o.vid end # @see the `==` method def eql?(o) self == o end # Calculate hash code according to all attributes. def hash [id, unique_name, latest_version, last_updated, name, description, uid, oid, has_cloud_connector, approved, published, protected, in_store, owned_by_current_user, tags, rsp, issuer_dn, vid].hash end # build the object from hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) else #TODO show warning in debug mode end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) else # data not found in attributes(hash), not an issue as the data can be optional end end self end def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /^(true|t|yes|y|1)$/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?.+), (?.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model _model = ArtikCloud.const_get(type).new _model.build_from_hash(value) end end def to_s to_hash.to_s end # to_body is an alias to to_body (backward compatibility)) def to_body to_hash end # return the object in the form of hash def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end # Method to output non-array value in the form of hash # For object, use to_hash. Otherwise, just return the value def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end end end