Class: Verizon::CampaignSoftware
- Defined in:
- lib/verizon/models/campaign_software.rb
Overview
Software upgrade information.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account identifier.
-
#campaign_name ⇒ String
Campaign name.
-
#distribution_type ⇒ String
LWM2M, OMD-DM or HTTP.
-
#download_after_date ⇒ Date
Specifies starting date client should download package.
-
#download_time_window_list ⇒ Array[V2TimeWindow]
List of allowed download time windows.
-
#end_date ⇒ Date
Campaign end date.
-
#id ⇒ String
Upgrade identifier.
-
#install_after_date ⇒ Date
Client will install package after date.
-
#install_time_window_list ⇒ Array[V2TimeWindow]
List of allowed install time windows.
-
#make ⇒ String
Applicable make.
-
#model ⇒ String
Applicable model.
-
#software_from ⇒ String
Old software name.
-
#software_name ⇒ String
Software name.
-
#software_to ⇒ String
New software name.
-
#start_date ⇒ Date
Campaign start date.
-
#status ⇒ String
Software upgrade status.
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(id = nil, account_name = nil, software_name = nil, distribution_type = nil, make = nil, model = nil, software_from = nil, software_to = nil, start_date = nil, end_date = nil, status = nil, campaign_name = SKIP, download_after_date = SKIP, download_time_window_list = SKIP, install_after_date = SKIP, install_time_window_list = SKIP) ⇒ CampaignSoftware
constructor
A new instance of CampaignSoftware.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, account_name = nil, software_name = nil, distribution_type = nil, make = nil, model = nil, software_from = nil, software_to = nil, start_date = nil, end_date = nil, status = nil, campaign_name = SKIP, download_after_date = SKIP, download_time_window_list = SKIP, install_after_date = SKIP, install_time_window_list = SKIP) ⇒ CampaignSoftware
Returns a new instance of CampaignSoftware.
116 117 118 119 120 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 150 151 |
# File 'lib/verizon/models/campaign_software.rb', line 116 def initialize(id = nil, account_name = nil, software_name = nil, distribution_type = nil, make = nil, model = nil, software_from = nil, software_to = nil, start_date = nil, end_date = nil, status = nil, campaign_name = SKIP, download_after_date = SKIP, download_time_window_list = SKIP, install_after_date = SKIP, install_time_window_list = SKIP) @id = id @account_name = account_name @campaign_name = campaign_name unless campaign_name == SKIP @software_name = software_name @distribution_type = distribution_type @make = make @model = model @software_from = software_from @software_to = software_to @start_date = start_date @end_date = end_date @download_after_date = download_after_date unless download_after_date == SKIP unless download_time_window_list == SKIP @download_time_window_list = download_time_window_list end @install_after_date = install_after_date unless install_after_date == SKIP @install_time_window_list = install_time_window_list unless install_time_window_list == SKIP @status = status end |
Instance Attribute Details
#account_name ⇒ String
Account identifier.
18 19 20 |
# File 'lib/verizon/models/campaign_software.rb', line 18 def account_name @account_name end |
#campaign_name ⇒ String
Campaign name.
22 23 24 |
# File 'lib/verizon/models/campaign_software.rb', line 22 def campaign_name @campaign_name end |
#distribution_type ⇒ String
LWM2M, OMD-DM or HTTP.
30 31 32 |
# File 'lib/verizon/models/campaign_software.rb', line 30 def distribution_type @distribution_type end |
#download_after_date ⇒ Date
Specifies starting date client should download package. If null, client will download as soon as possible.
59 60 61 |
# File 'lib/verizon/models/campaign_software.rb', line 59 def download_after_date @download_after_date end |
#download_time_window_list ⇒ Array[V2TimeWindow]
List of allowed download time windows.
63 64 65 |
# File 'lib/verizon/models/campaign_software.rb', line 63 def download_time_window_list @download_time_window_list end |
#end_date ⇒ Date
Campaign end date.
54 55 56 |
# File 'lib/verizon/models/campaign_software.rb', line 54 def end_date @end_date end |
#id ⇒ String
Upgrade identifier.
14 15 16 |
# File 'lib/verizon/models/campaign_software.rb', line 14 def id @id end |
#install_after_date ⇒ Date
Client will install package after date. If null, client will install as soon as possible.
68 69 70 |
# File 'lib/verizon/models/campaign_software.rb', line 68 def install_after_date @install_after_date end |
#install_time_window_list ⇒ Array[V2TimeWindow]
List of allowed install time windows.
72 73 74 |
# File 'lib/verizon/models/campaign_software.rb', line 72 def install_time_window_list @install_time_window_list end |
#make ⇒ String
Applicable make.
34 35 36 |
# File 'lib/verizon/models/campaign_software.rb', line 34 def make @make end |
#model ⇒ String
Applicable model.
38 39 40 |
# File 'lib/verizon/models/campaign_software.rb', line 38 def model @model end |
#software_from ⇒ String
Old software name.
42 43 44 |
# File 'lib/verizon/models/campaign_software.rb', line 42 def software_from @software_from end |
#software_name ⇒ String
Software name.
26 27 28 |
# File 'lib/verizon/models/campaign_software.rb', line 26 def software_name @software_name end |
#software_to ⇒ String
New software name.
46 47 48 |
# File 'lib/verizon/models/campaign_software.rb', line 46 def software_to @software_to end |
#start_date ⇒ Date
Campaign start date.
50 51 52 |
# File 'lib/verizon/models/campaign_software.rb', line 50 def start_date @start_date end |
#status ⇒ String
Software upgrade status.
76 77 78 |
# File 'lib/verizon/models/campaign_software.rb', line 76 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
154 155 156 157 158 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 |
# File 'lib/verizon/models/campaign_software.rb', line 154 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil account_name = hash.key?('accountName') ? hash['accountName'] : nil software_name = hash.key?('softwareName') ? hash['softwareName'] : nil distribution_type = hash.key?('distributionType') ? hash['distributionType'] : nil make = hash.key?('make') ? hash['make'] : nil model = hash.key?('model') ? hash['model'] : nil software_from = hash.key?('softwareFrom') ? hash['softwareFrom'] : nil software_to = hash.key?('softwareTo') ? hash['softwareTo'] : nil start_date = hash.key?('startDate') ? hash['startDate'] : nil end_date = hash.key?('endDate') ? hash['endDate'] : nil status = hash.key?('status') ? hash['status'] : nil campaign_name = hash.key?('campaignName') ? hash['campaignName'] : SKIP download_after_date = hash.key?('downloadAfterDate') ? hash['downloadAfterDate'] : SKIP # Parameter is an array, so we need to iterate through it download_time_window_list = nil unless hash['downloadTimeWindowList'].nil? download_time_window_list = [] hash['downloadTimeWindowList'].each do |structure| download_time_window_list << (V2TimeWindow.from_hash(structure) if structure) end end download_time_window_list = SKIP unless hash.key?('downloadTimeWindowList') install_after_date = hash.key?('installAfterDate') ? hash['installAfterDate'] : SKIP # Parameter is an array, so we need to iterate through it install_time_window_list = nil unless hash['installTimeWindowList'].nil? install_time_window_list = [] hash['installTimeWindowList'].each do |structure| install_time_window_list << (V2TimeWindow.from_hash(structure) if structure) end end install_time_window_list = SKIP unless hash.key?('installTimeWindowList') # Create object from extracted values. CampaignSoftware.new(id, account_name, software_name, distribution_type, make, model, software_from, software_to, start_date, end_date, status, campaign_name, download_after_date, download_time_window_list, install_after_date, install_time_window_list) end |
.names ⇒ Object
A mapping from model property names to API property names.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/verizon/models/campaign_software.rb', line 79 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['account_name'] = 'accountName' @_hash['campaign_name'] = 'campaignName' @_hash['software_name'] = 'softwareName' @_hash['distribution_type'] = 'distributionType' @_hash['make'] = 'make' @_hash['model'] = 'model' @_hash['software_from'] = 'softwareFrom' @_hash['software_to'] = 'softwareTo' @_hash['start_date'] = 'startDate' @_hash['end_date'] = 'endDate' @_hash['download_after_date'] = 'downloadAfterDate' @_hash['download_time_window_list'] = 'downloadTimeWindowList' @_hash['install_after_date'] = 'installAfterDate' @_hash['install_time_window_list'] = 'installTimeWindowList' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
112 113 114 |
# File 'lib/verizon/models/campaign_software.rb', line 112 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
101 102 103 104 105 106 107 108 109 |
# File 'lib/verizon/models/campaign_software.rb', line 101 def self.optionals %w[ campaign_name download_after_date download_time_window_list install_after_date install_time_window_list ] end |