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:, earliest: SKIP, latest: SKIP) ⇒ SmsEventHistoryRequest
constructor
A new instance of SmsEventHistoryRequest.
-
#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(device_id:, earliest: SKIP, latest: SKIP) ⇒ SmsEventHistoryRequest
Returns a new instance of SmsEventHistoryRequest.
47 48 49 50 51 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 47 def initialize(device_id:, 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.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 54 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: device_id, earliest: earliest, latest: 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
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
91 92 93 94 95 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} device_id: #{@device_id.inspect}, earliest: #{@earliest.inspect}, latest:"\ " #{@latest.inspect}>" end |
#to_custom_earliest ⇒ Object
76 77 78 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 76 def to_custom_earliest DateTimeHelper.to_rfc3339(earliest) end |
#to_custom_latest ⇒ Object
80 81 82 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 80 def to_custom_latest DateTimeHelper.to_rfc3339(latest) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
85 86 87 88 |
# File 'lib/verizon/models/sms_event_history_request.rb', line 85 def to_s class_name = self.class.name.split('::').last "<#{class_name} device_id: #{@device_id}, earliest: #{@earliest}, latest: #{@latest}>" end |