Class: Verizon::ESIMProvhistoryRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::ESIMProvhistoryRequest
- Defined in:
- lib/verizon/models/esim_provhistory_request.rb
Overview
ESIMProvhistoryRequest Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#device_filter ⇒ Array[DeviceId2]
TODO: Write general description for this method.
-
#earliest ⇒ DateTime
TODO: Write general description for this method.
-
#latest ⇒ DateTime
TODO: Write general description for this method.
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(account_name = SKIP, device_filter = SKIP, earliest = SKIP, latest = SKIP) ⇒ ESIMProvhistoryRequest
constructor
A new instance of ESIMProvhistoryRequest.
- #to_custom_earliest ⇒ Object
- #to_custom_latest ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = SKIP, device_filter = SKIP, earliest = SKIP, latest = SKIP) ⇒ ESIMProvhistoryRequest
Returns a new instance of ESIMProvhistoryRequest.
54 55 56 57 58 59 60 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 54 def initialize(account_name = SKIP, device_filter = SKIP, earliest = SKIP, latest = SKIP) @account_name = account_name unless account_name == SKIP @device_filter = device_filter unless device_filter == SKIP @earliest = earliest unless earliest == SKIP @latest = latest unless latest == SKIP end |
Instance Attribute Details
#account_name ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 15 def account_name @account_name end |
#device_filter ⇒ Array[DeviceId2]
TODO: Write general description for this method
19 20 21 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 19 def device_filter @device_filter end |
#earliest ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 23 def earliest @earliest end |
#latest ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 27 def latest @latest end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : SKIP # Parameter is an array, so we need to iterate through it device_filter = nil unless hash['deviceFilter'].nil? device_filter = [] hash['deviceFilter'].each do |structure| device_filter << (DeviceId2.from_hash(structure) if structure) end end device_filter = SKIP unless hash.key?('deviceFilter') earliest = if hash.key?('earliest') (DateTimeHelper.from_rfc3339(hash['earliest']) if hash['earliest']) else SKIP end latest = if hash.key?('latest') (DateTimeHelper.from_rfc3339(hash['latest']) if hash['latest']) else SKIP end # Create object from extracted values. ESIMProvhistoryRequest.new(account_name, device_filter, earliest, latest) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['device_filter'] = 'deviceFilter' @_hash['earliest'] = 'earliest' @_hash['latest'] = 'latest' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 40 def self.optionals %w[ account_name device_filter earliest latest ] end |
Instance Method Details
#to_custom_earliest ⇒ Object
96 97 98 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 96 def to_custom_earliest DateTimeHelper.to_rfc3339(earliest) end |
#to_custom_latest ⇒ Object
100 101 102 |
# File 'lib/verizon/models/esim_provhistory_request.rb', line 100 def to_custom_latest DateTimeHelper.to_rfc3339(latest) end |