Class: Nodeum::Tape
- Inherits:
-
Object
- Object
- Nodeum::Tape
- Defined in:
- lib/nodeum_sdk/models/tape.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#barcode ⇒ Object
Returns the value of attribute barcode.
-
#cleaning ⇒ Object
Returns the value of attribute cleaning.
-
#date_in ⇒ Object
Returns the value of attribute date_in.
-
#date_move ⇒ Object
Returns the value of attribute date_move.
-
#ejected ⇒ Object
Returns the value of attribute ejected.
-
#force_import_type ⇒ Object
Returns the value of attribute force_import_type.
-
#free ⇒ Object
Returns the value of attribute free.
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#id ⇒ Object
Returns the value of attribute id.
-
#known ⇒ Object
Returns the value of attribute known.
-
#last_maintenance ⇒ Object
Returns the value of attribute last_maintenance.
-
#last_repack ⇒ Object
Returns the value of attribute last_repack.
-
#last_size_update ⇒ Object
Returns the value of attribute last_size_update.
-
#location ⇒ Object
Returns the value of attribute location.
-
#locked ⇒ Object
Returns the value of attribute locked.
-
#max ⇒ Object
Returns the value of attribute max.
-
#mount_count ⇒ Object
Returns the value of attribute mount_count.
-
#mounted ⇒ Object
Returns the value of attribute mounted.
-
#need_to_check ⇒ Object
Returns the value of attribute need_to_check.
-
#pool_id ⇒ Object
Returns the value of attribute pool_id.
-
#repack_status ⇒ Object
Returns the value of attribute repack_status.
-
#scratch ⇒ Object
Returns the value of attribute scratch.
-
#tape_library_id ⇒ Object
Returns the value of attribute tape_library_id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#write_protect ⇒ Object
Returns the value of attribute write_protect.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Tape
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Tape
Initializes the object
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/nodeum_sdk/models/tape.rb', line 159 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Nodeum::Tape` 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 `Nodeum::Tape`. 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?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'tape_library_id') self.tape_library_id = attributes[:'tape_library_id'] end if attributes.key?(:'pool_id') self.pool_id = attributes[:'pool_id'] end if attributes.key?(:'barcode') self. = attributes[:'barcode'] end if attributes.key?(:'location') self.location = attributes[:'location'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'locked') self.locked = attributes[:'locked'] end if attributes.key?(:'scratch') self.scratch = attributes[:'scratch'] end if attributes.key?(:'cleaning') self.cleaning = attributes[:'cleaning'] end if attributes.key?(:'write_protect') self.write_protect = attributes[:'write_protect'] end if attributes.key?(:'mounted') self.mounted = attributes[:'mounted'] end if attributes.key?(:'ejected') self.ejected = attributes[:'ejected'] end if attributes.key?(:'known') self.known = attributes[:'known'] end if attributes.key?(:'mount_count') self.mount_count = attributes[:'mount_count'] end if attributes.key?(:'date_in') self.date_in = attributes[:'date_in'] end if attributes.key?(:'date_move') self.date_move = attributes[:'date_move'] end if attributes.key?(:'free') self.free = attributes[:'free'] end if attributes.key?(:'max') self.max = attributes[:'max'] end if attributes.key?(:'last_size_update') self.last_size_update = attributes[:'last_size_update'] end if attributes.key?(:'last_maintenance') self.last_maintenance = attributes[:'last_maintenance'] end if attributes.key?(:'last_repack') self.last_repack = attributes[:'last_repack'] end if attributes.key?(:'repack_status') self.repack_status = attributes[:'repack_status'] end if attributes.key?(:'hash') self.hash = attributes[:'hash'] end if attributes.key?(:'force_import_type') self.force_import_type = attributes[:'force_import_type'] end if attributes.key?(:'need_to_check') self.need_to_check = attributes[:'need_to_check'] end end |
Instance Attribute Details
#barcode ⇒ Object
Returns the value of attribute barcode.
23 24 25 |
# File 'lib/nodeum_sdk/models/tape.rb', line 23 def @barcode end |
#cleaning ⇒ Object
Returns the value of attribute cleaning.
33 34 35 |
# File 'lib/nodeum_sdk/models/tape.rb', line 33 def cleaning @cleaning end |
#date_in ⇒ Object
Returns the value of attribute date_in.
45 46 47 |
# File 'lib/nodeum_sdk/models/tape.rb', line 45 def date_in @date_in end |
#date_move ⇒ Object
Returns the value of attribute date_move.
47 48 49 |
# File 'lib/nodeum_sdk/models/tape.rb', line 47 def date_move @date_move end |
#ejected ⇒ Object
Returns the value of attribute ejected.
39 40 41 |
# File 'lib/nodeum_sdk/models/tape.rb', line 39 def ejected @ejected end |
#force_import_type ⇒ Object
Returns the value of attribute force_import_type.
63 64 65 |
# File 'lib/nodeum_sdk/models/tape.rb', line 63 def force_import_type @force_import_type end |
#free ⇒ Object
Returns the value of attribute free.
49 50 51 |
# File 'lib/nodeum_sdk/models/tape.rb', line 49 def free @free end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
338 339 340 |
# File 'lib/nodeum_sdk/models/tape.rb', line 338 def hash @hash end |
#id ⇒ Object
Returns the value of attribute id.
17 18 19 |
# File 'lib/nodeum_sdk/models/tape.rb', line 17 def id @id end |
#known ⇒ Object
Returns the value of attribute known.
41 42 43 |
# File 'lib/nodeum_sdk/models/tape.rb', line 41 def known @known end |
#last_maintenance ⇒ Object
Returns the value of attribute last_maintenance.
55 56 57 |
# File 'lib/nodeum_sdk/models/tape.rb', line 55 def last_maintenance @last_maintenance end |
#last_repack ⇒ Object
Returns the value of attribute last_repack.
57 58 59 |
# File 'lib/nodeum_sdk/models/tape.rb', line 57 def last_repack @last_repack end |
#last_size_update ⇒ Object
Returns the value of attribute last_size_update.
53 54 55 |
# File 'lib/nodeum_sdk/models/tape.rb', line 53 def last_size_update @last_size_update end |
#location ⇒ Object
Returns the value of attribute location.
25 26 27 |
# File 'lib/nodeum_sdk/models/tape.rb', line 25 def location @location end |
#locked ⇒ Object
Returns the value of attribute locked.
29 30 31 |
# File 'lib/nodeum_sdk/models/tape.rb', line 29 def locked @locked end |
#max ⇒ Object
Returns the value of attribute max.
51 52 53 |
# File 'lib/nodeum_sdk/models/tape.rb', line 51 def max @max end |
#mount_count ⇒ Object
Returns the value of attribute mount_count.
43 44 45 |
# File 'lib/nodeum_sdk/models/tape.rb', line 43 def mount_count @mount_count end |
#mounted ⇒ Object
Returns the value of attribute mounted.
37 38 39 |
# File 'lib/nodeum_sdk/models/tape.rb', line 37 def mounted @mounted end |
#need_to_check ⇒ Object
Returns the value of attribute need_to_check.
65 66 67 |
# File 'lib/nodeum_sdk/models/tape.rb', line 65 def need_to_check @need_to_check end |
#pool_id ⇒ Object
Returns the value of attribute pool_id.
21 22 23 |
# File 'lib/nodeum_sdk/models/tape.rb', line 21 def pool_id @pool_id end |
#repack_status ⇒ Object
Returns the value of attribute repack_status.
59 60 61 |
# File 'lib/nodeum_sdk/models/tape.rb', line 59 def repack_status @repack_status end |
#scratch ⇒ Object
Returns the value of attribute scratch.
31 32 33 |
# File 'lib/nodeum_sdk/models/tape.rb', line 31 def scratch @scratch end |
#tape_library_id ⇒ Object
Returns the value of attribute tape_library_id.
19 20 21 |
# File 'lib/nodeum_sdk/models/tape.rb', line 19 def tape_library_id @tape_library_id end |
#type ⇒ Object
Returns the value of attribute type.
27 28 29 |
# File 'lib/nodeum_sdk/models/tape.rb', line 27 def type @type end |
#write_protect ⇒ Object
Returns the value of attribute write_protect.
35 36 37 |
# File 'lib/nodeum_sdk/models/tape.rb', line 35 def write_protect @write_protect end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/nodeum_sdk/models/tape.rb', line 90 def self.attribute_map { :'id' => :'id', :'tape_library_id' => :'tape_library_id', :'pool_id' => :'pool_id', :'barcode' => :'barcode', :'location' => :'location', :'type' => :'type', :'locked' => :'locked', :'scratch' => :'scratch', :'cleaning' => :'cleaning', :'write_protect' => :'write_protect', :'mounted' => :'mounted', :'ejected' => :'ejected', :'known' => :'known', :'mount_count' => :'mount_count', :'date_in' => :'date_in', :'date_move' => :'date_move', :'free' => :'free', :'max' => :'max', :'last_size_update' => :'last_size_update', :'last_maintenance' => :'last_maintenance', :'last_repack' => :'last_repack', :'repack_status' => :'repack_status', :'hash' => :'hash', :'force_import_type' => :'force_import_type', :'need_to_check' => :'need_to_check' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
345 346 347 |
# File 'lib/nodeum_sdk/models/tape.rb', line 345 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
152 153 154 155 |
# File 'lib/nodeum_sdk/models/tape.rb', line 152 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/nodeum_sdk/models/tape.rb', line 121 def self.openapi_types { :'id' => :'Integer', :'tape_library_id' => :'Integer', :'pool_id' => :'Integer', :'barcode' => :'String', :'location' => :'String', :'type' => :'String', :'locked' => :'Boolean', :'scratch' => :'Boolean', :'cleaning' => :'Boolean', :'write_protect' => :'Boolean', :'mounted' => :'Boolean', :'ejected' => :'Boolean', :'known' => :'Boolean', :'mount_count' => :'Integer', :'date_in' => :'String', :'date_move' => :'String', :'free' => :'Integer', :'max' => :'Integer', :'last_size_update' => :'String', :'last_maintenance' => :'String', :'last_repack' => :'String', :'repack_status' => :'Boolean', :'hash' => :'String', :'force_import_type' => :'Boolean', :'need_to_check' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/nodeum_sdk/models/tape.rb', line 300 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && tape_library_id == o.tape_library_id && pool_id == o.pool_id && == o. && location == o.location && type == o.type && locked == o.locked && scratch == o.scratch && cleaning == o.cleaning && write_protect == o.write_protect && mounted == o.mounted && ejected == o.ejected && known == o.known && mount_count == o.mount_count && date_in == o.date_in && date_move == o.date_move && free == o.free && max == o.max && last_size_update == o.last_size_update && last_maintenance == o.last_maintenance && last_repack == o.last_repack && repack_status == o.repack_status && hash == o.hash && force_import_type == o.force_import_type && need_to_check == o.need_to_check end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/nodeum_sdk/models/tape.rb', line 373 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 =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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 Nodeum.const_get(type).build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/nodeum_sdk/models/tape.rb', line 442 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/nodeum_sdk/models/tape.rb', line 352 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(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?(o) ⇒ Boolean
332 333 334 |
# File 'lib/nodeum_sdk/models/tape.rb', line 332 def eql?(o) self == o end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
275 276 277 278 |
# File 'lib/nodeum_sdk/models/tape.rb', line 275 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
418 419 420 |
# File 'lib/nodeum_sdk/models/tape.rb', line 418 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
424 425 426 427 428 429 430 431 432 433 434 435 436 |
# File 'lib/nodeum_sdk/models/tape.rb', line 424 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 hash end |
#to_s ⇒ String
Returns the string representation of the object
412 413 414 |
# File 'lib/nodeum_sdk/models/tape.rb', line 412 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
282 283 284 285 286 |
# File 'lib/nodeum_sdk/models/tape.rb', line 282 def valid? type_validator = EnumAttributeValidator.new('String', ["unknown", "data", "cleaning", "diagnostic", "data_lto1", "data_lto2", "data_lto3", "data_lto4", "data_lto5", "data_lto6", "data_lto7", "data_lto8", "data_lto9", "data_lto10", "data_lto11", "data_lto12"]) return false unless type_validator.valid?(@type) true end |