Class: Verizon::SoftwarePackage
- Defined in:
- lib/verizon/models/software_package.rb
Overview
Software package information.
Instance Attribute Summary collapse
-
#device_platform_id ⇒ String
The platform (Android, iOS, etc.) that the software can be applied to.
-
#distribution_type ⇒ String
LWM2M, OMD-DM or HTTP.
-
#launch_date ⇒ Date
Software launch date.
-
#make ⇒ String
Software applicable device make.
-
#model ⇒ String
Software applicable device model.
-
#release_note ⇒ String
Software release note reserved for future use.
-
#software_name ⇒ String
Software name.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(software_name:, launch_date:, model:, make:, distribution_type:, device_platform_id:, release_note: SKIP, additional_properties: nil) ⇒ SoftwarePackage
constructor
A new instance of SoftwarePackage.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(software_name:, launch_date:, model:, make:, distribution_type:, device_platform_id:, release_note: SKIP, additional_properties: nil) ⇒ SoftwarePackage
Returns a new instance of SoftwarePackage.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/verizon/models/software_package.rb', line 65 def initialize(software_name:, launch_date:, model:, make:, distribution_type:, device_platform_id:, release_note: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @software_name = software_name @launch_date = launch_date @release_note = release_note unless release_note == SKIP @model = model @make = make @distribution_type = distribution_type @device_platform_id = device_platform_id @additional_properties = additional_properties end |
Instance Attribute Details
#device_platform_id ⇒ String
The platform (Android, iOS, etc.) that the software can be applied to.
38 39 40 |
# File 'lib/verizon/models/software_package.rb', line 38 def device_platform_id @device_platform_id end |
#distribution_type ⇒ String
LWM2M, OMD-DM or HTTP.
34 35 36 |
# File 'lib/verizon/models/software_package.rb', line 34 def distribution_type @distribution_type end |
#launch_date ⇒ Date
Software launch date.
18 19 20 |
# File 'lib/verizon/models/software_package.rb', line 18 def launch_date @launch_date end |
#make ⇒ String
Software applicable device make.
30 31 32 |
# File 'lib/verizon/models/software_package.rb', line 30 def make @make end |
#model ⇒ String
Software applicable device model.
26 27 28 |
# File 'lib/verizon/models/software_package.rb', line 26 def model @model end |
#release_note ⇒ String
Software release note reserved for future use.
22 23 24 |
# File 'lib/verizon/models/software_package.rb', line 22 def release_note @release_note end |
#software_name ⇒ String
Software name.
14 15 16 |
# File 'lib/verizon/models/software_package.rb', line 14 def software_name @software_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/verizon/models/software_package.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. software_name = hash.key?('softwareName') ? hash['softwareName'] : nil launch_date = hash.key?('launchDate') ? hash['launchDate'] : nil model = hash.key?('model') ? hash['model'] : nil make = hash.key?('make') ? hash['make'] : nil distribution_type = hash.key?('distributionType') ? hash['distributionType'] : nil device_platform_id = hash.key?('devicePlatformId') ? hash['devicePlatformId'] : nil release_note = hash.key?('releaseNote') ? hash['releaseNote'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. SoftwarePackage.new(software_name: software_name, launch_date: launch_date, model: model, make: make, distribution_type: distribution_type, device_platform_id: device_platform_id, release_note: release_note, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/verizon/models/software_package.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['software_name'] = 'softwareName' @_hash['launch_date'] = 'launchDate' @_hash['release_note'] = 'releaseNote' @_hash['model'] = 'model' @_hash['make'] = 'make' @_hash['distribution_type'] = 'distributionType' @_hash['device_platform_id'] = 'devicePlatformId' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/verizon/models/software_package.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 |
# File 'lib/verizon/models/software_package.rb', line 54 def self.optionals %w[ release_note ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
124 125 126 127 128 129 130 131 |
# File 'lib/verizon/models/software_package.rb', line 124 def inspect class_name = self.class.name.split('::').last "<#{class_name} software_name: #{@software_name.inspect}, launch_date:"\ " #{@launch_date.inspect}, release_note: #{@release_note.inspect}, model: #{@model.inspect},"\ " make: #{@make.inspect}, distribution_type: #{@distribution_type.inspect},"\ " device_platform_id: #{@device_platform_id.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
115 116 117 118 119 120 121 |
# File 'lib/verizon/models/software_package.rb', line 115 def to_s class_name = self.class.name.split('::').last "<#{class_name} software_name: #{@software_name}, launch_date: #{@launch_date},"\ " release_note: #{@release_note}, model: #{@model}, make: #{@make}, distribution_type:"\ " #{@distribution_type}, device_platform_id: #{@device_platform_id}, additional_properties:"\ " #{@additional_properties}>" end |