Class: Verizon::ProvhistoryRequest
- Defined in:
- lib/verizon/models/provhistory_request.rb
Overview
ProvhistoryRequest Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#device_filter ⇒ Array[GioDeviceId]
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) ⇒ ProvhistoryRequest
constructor
A new instance of ProvhistoryRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_earliest ⇒ Object
- #to_custom_latest ⇒ Object
-
#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(account_name: SKIP, device_filter: SKIP, earliest: SKIP, latest: SKIP) ⇒ ProvhistoryRequest
Returns a new instance of ProvhistoryRequest.
54 55 56 57 58 59 60 |
# File 'lib/verizon/models/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/provhistory_request.rb', line 15 def account_name @account_name end |
#device_filter ⇒ Array[GioDeviceId]
TODO: Write general description for this method
19 20 21 |
# File 'lib/verizon/models/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/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/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/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 << (GioDeviceId.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. ProvhistoryRequest.new(account_name: account_name, device_filter: device_filter, earliest: earliest, latest: 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/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/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/provhistory_request.rb', line 40 def self.optionals %w[ account_name device_filter earliest latest ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
112 113 114 115 116 |
# File 'lib/verizon/models/provhistory_request.rb', line 112 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_name: #{@account_name.inspect}, device_filter:"\ " #{@device_filter.inspect}, earliest: #{@earliest.inspect}, latest: #{@latest.inspect}>" end |
#to_custom_earliest ⇒ Object
96 97 98 |
# File 'lib/verizon/models/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/provhistory_request.rb', line 100 def to_custom_latest DateTimeHelper.to_rfc3339(latest) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 |
# File 'lib/verizon/models/provhistory_request.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_name: #{@account_name}, device_filter: #{@device_filter}, earliest:"\ " #{@earliest}, latest: #{@latest}>" end |