Class: Verizon::SMSEventHistoryRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::SMSEventHistoryRequest
- Defined in:
- lib/verizon/models/sms_event_history_request.rb
Overview
SMSEventHistoryRequest Model.
Instance Attribute Summary collapse
-
#device_id ⇒ 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(device_id = nil, earliest = SKIP, latest = SKIP) ⇒ SMSEventHistoryRequest
constructor
A new instance of SMSEventHistoryRequest.
- #to_custom_earliest ⇒ Object
- #to_custom_latest ⇒ Object
Methods inherited from BaseModel
Constructor Details
#initialize(device_id = nil, earliest = SKIP, latest = SKIP) ⇒ SMSEventHistoryRequest
Returns a new instance of SMSEventHistoryRequest.
47 48 49 50 51 52 53 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 47 def initialize(device_id = nil, earliest = SKIP, latest = SKIP) @device_id = device_id @earliest = earliest unless earliest == SKIP @latest = latest unless latest == SKIP end |
Instance Attribute Details
#device_id ⇒ GIODeviceId
TODO: Write general description for this method
15 16 17 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 15 def device_id @device_id end |
#earliest ⇒ DateTime
TODO: Write general description for this method
19 20 21 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 19 def earliest @earliest end |
#latest ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 23 def latest @latest end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. device_id = GIODeviceId.from_hash(hash['deviceId']) if hash['deviceId'] 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. SMSEventHistoryRequest.new(device_id, earliest, latest) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['device_id'] = 'deviceId' @_hash['earliest'] = 'earliest' @_hash['latest'] = 'latest' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 35 def self.optionals %w[ earliest latest ] end |
Instance Method Details
#to_custom_earliest ⇒ Object
78 79 80 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 78 def to_custom_earliest DateTimeHelper.to_rfc3339(earliest) end |
#to_custom_latest ⇒ Object
82 83 84 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 82 def to_custom_latest DateTimeHelper.to_rfc3339(latest) end |