Class: Verizon::SessionReportRequest
- Defined in:
- lib/verizon/models/session_report_request.rb
Overview
Request for obtaining a session report.
Instance Attribute Summary collapse
-
#account_number ⇒ String
The numeric ID of the account and must include leading zeroes.
-
#duration_high ⇒ Integer
Optional filter — maximum session duration.
-
#duration_low ⇒ Integer
Optional filter — minimum session duration.
-
#end_date ⇒ String
End date of session to include.
-
#imei ⇒ String
The International Mobile Equipment Identifier of the device.
-
#start_date ⇒ String
Start date of session to include.
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_number = nil, imei = nil, start_date = SKIP, end_date = SKIP, duration_low = SKIP, duration_high = SKIP) ⇒ SessionReportRequest
constructor
A new instance of SessionReportRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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_number = nil, imei = nil, start_date = SKIP, end_date = SKIP, duration_low = SKIP, duration_high = SKIP) ⇒ SessionReportRequest
Returns a new instance of SessionReportRequest.
68 69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/session_report_request.rb', line 68 def initialize(account_number = nil, imei = nil, start_date = SKIP, end_date = SKIP, duration_low = SKIP, duration_high = SKIP) @account_number = account_number @imei = imei @start_date = start_date unless start_date == SKIP @end_date = end_date unless end_date == SKIP @duration_low = duration_low unless duration_low == SKIP @duration_high = duration_high unless duration_high == SKIP end |
Instance Attribute Details
#account_number ⇒ String
The numeric ID of the account and must include leading zeroes. This value is indentical to ‘accountName`.
15 16 17 |
# File 'lib/verizon/models/session_report_request.rb', line 15 def account_number @account_number end |
#duration_high ⇒ Integer
Optional filter — maximum session duration
39 40 41 |
# File 'lib/verizon/models/session_report_request.rb', line 39 def duration_high @duration_high end |
#duration_low ⇒ Integer
Optional filter — minimum session duration
35 36 37 |
# File 'lib/verizon/models/session_report_request.rb', line 35 def duration_low @duration_low end |
#end_date ⇒ String
End date of session to include. If not specified information will be shown to the latest available. Can be either date in ISO 8601 format or predefined constants.
31 32 33 |
# File 'lib/verizon/models/session_report_request.rb', line 31 def end_date @end_date end |
#imei ⇒ String
The International Mobile Equipment Identifier of the device.
19 20 21 |
# File 'lib/verizon/models/session_report_request.rb', line 19 def imei @imei end |
#start_date ⇒ String
Start date of session to include. If not specified information will be shown from the earliest available (180 days). Can be either date in ISO 8601 format or predefined constants.
25 26 27 |
# File 'lib/verizon/models/session_report_request.rb', line 25 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/verizon/models/session_report_request.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = hash.key?('accountNumber') ? hash['accountNumber'] : nil imei = hash.key?('imei') ? hash['imei'] : nil start_date = hash.key?('startDate') ? hash['startDate'] : SKIP end_date = hash.key?('endDate') ? hash['endDate'] : SKIP duration_low = hash.key?('durationLow') ? hash['durationLow'] : SKIP duration_high = hash.key?('durationHigh') ? hash['durationHigh'] : SKIP # Create object from extracted values. SessionReportRequest.new(account_number, imei, start_date, end_date, duration_low, duration_high) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/verizon/models/session_report_request.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['account_number'] = 'accountNumber' @_hash['imei'] = 'imei' @_hash['start_date'] = 'startDate' @_hash['end_date'] = 'endDate' @_hash['duration_low'] = 'durationLow' @_hash['duration_high'] = 'durationHigh' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/verizon/models/session_report_request.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/session_report_request.rb', line 54 def self.optionals %w[ start_date end_date duration_low duration_high ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
108 109 110 111 112 113 |
# File 'lib/verizon/models/session_report_request.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number.inspect}, imei: #{@imei.inspect},"\ " start_date: #{@start_date.inspect}, end_date: #{@end_date.inspect}, duration_low:"\ " #{@duration_low.inspect}, duration_high: #{@duration_high.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
100 101 102 103 104 105 |
# File 'lib/verizon/models/session_report_request.rb', line 100 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number}, imei: #{@imei}, start_date:"\ " #{@start_date}, end_date: #{@end_date}, duration_low: #{@duration_low}, duration_high:"\ " #{@duration_high}>" end |