Class: OCI::Desktops::Models::DesktopConnection
- Inherits:
-
Object
- Object
- OCI::Desktops::Models::DesktopConnection
- Defined in:
- lib/oci/desktops/models/desktop_connection.rb
Overview
Provides information about a connection to a desktop, including connect and disconnect time, and client properties.
Instance Attribute Summary collapse
-
#client_platform ⇒ String
The platform on which the Secure Desktops client runs.
-
#client_type ⇒ String
The type of Secure Desktops client connected to a desktop.
-
#client_version ⇒ String
The version of the Secure Desktops client connected to a desktop, applicable only to the installed client type.
- #last_action ⇒ OCI::Desktops::Models::DesktopAction
- #next_action ⇒ OCI::Desktops::Models::DesktopAction
-
#time_connected ⇒ DateTime
The time when the last connection to a desktop started.
-
#time_disconnected ⇒ DateTime
The time when the last connection to a desktop ended.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ DesktopConnection
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ DesktopConnection
Initializes the object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 80 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.time_connected = attributes[:'timeConnected'] if attributes[:'timeConnected'] raise 'You cannot provide both :timeConnected and :time_connected' if attributes.key?(:'timeConnected') && attributes.key?(:'time_connected') self.time_connected = attributes[:'time_connected'] if attributes[:'time_connected'] self.time_disconnected = attributes[:'timeDisconnected'] if attributes[:'timeDisconnected'] raise 'You cannot provide both :timeDisconnected and :time_disconnected' if attributes.key?(:'timeDisconnected') && attributes.key?(:'time_disconnected') self.time_disconnected = attributes[:'time_disconnected'] if attributes[:'time_disconnected'] self.next_action = attributes[:'nextAction'] if attributes[:'nextAction'] raise 'You cannot provide both :nextAction and :next_action' if attributes.key?(:'nextAction') && attributes.key?(:'next_action') self.next_action = attributes[:'next_action'] if attributes[:'next_action'] self.last_action = attributes[:'lastAction'] if attributes[:'lastAction'] raise 'You cannot provide both :lastAction and :last_action' if attributes.key?(:'lastAction') && attributes.key?(:'last_action') self.last_action = attributes[:'last_action'] if attributes[:'last_action'] self.client_type = attributes[:'clientType'] if attributes[:'clientType'] raise 'You cannot provide both :clientType and :client_type' if attributes.key?(:'clientType') && attributes.key?(:'client_type') self.client_type = attributes[:'client_type'] if attributes[:'client_type'] self.client_version = attributes[:'clientVersion'] if attributes[:'clientVersion'] raise 'You cannot provide both :clientVersion and :client_version' if attributes.key?(:'clientVersion') && attributes.key?(:'client_version') self.client_version = attributes[:'client_version'] if attributes[:'client_version'] self.client_platform = attributes[:'clientPlatform'] if attributes[:'clientPlatform'] raise 'You cannot provide both :clientPlatform and :client_platform' if attributes.key?(:'clientPlatform') && attributes.key?(:'client_platform') self.client_platform = attributes[:'client_platform'] if attributes[:'client_platform'] end |
Instance Attribute Details
#client_platform ⇒ String
The platform on which the Secure Desktops client runs.
35 36 37 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 35 def client_platform @client_platform end |
#client_type ⇒ String
The type of Secure Desktops client connected to a desktop.
27 28 29 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 27 def client_type @client_type end |
#client_version ⇒ String
The version of the Secure Desktops client connected to a desktop, applicable only to the installed client type.
31 32 33 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 31 def client_version @client_version end |
#last_action ⇒ OCI::Desktops::Models::DesktopAction
23 24 25 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 23 def last_action @last_action end |
#next_action ⇒ OCI::Desktops::Models::DesktopAction
20 21 22 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 20 def next_action @next_action end |
#time_connected ⇒ DateTime
The time when the last connection to a desktop started.
13 14 15 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 13 def time_connected @time_connected end |
#time_disconnected ⇒ DateTime
The time when the last connection to a desktop ended.
17 18 19 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 17 def time_disconnected @time_disconnected end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 38 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'time_connected': :'timeConnected', 'time_disconnected': :'timeDisconnected', 'next_action': :'nextAction', 'last_action': :'lastAction', 'client_type': :'clientType', 'client_version': :'clientVersion', 'client_platform': :'clientPlatform' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 53 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'time_connected': :'DateTime', 'time_disconnected': :'DateTime', 'next_action': :'OCI::Desktops::Models::DesktopAction', 'last_action': :'OCI::Desktops::Models::DesktopAction', 'client_type': :'String', 'client_version': :'String', 'client_platform': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 136 def ==(other) return true if equal?(other) self.class == other.class && time_connected == other.time_connected && time_disconnected == other.time_disconnected && next_action == other.next_action && last_action == other.last_action && client_type == other.client_type && client_version == other.client_version && client_platform == other.client_platform end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 172 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 # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
152 153 154 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 152 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
161 162 163 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 161 def hash [time_connected, time_disconnected, next_action, last_action, client_type, client_version, client_platform].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
205 206 207 208 209 210 211 212 213 214 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 205 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
199 200 201 |
# File 'lib/oci/desktops/models/desktop_connection.rb', line 199 def to_s to_hash.to_s end |