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
Account Number.
-
#duration_high ⇒ Integer
The High value of session duration.
-
#duration_low ⇒ Integer
The Low value of session duration.
-
#end_date ⇒ String
End date of session to include.
-
#imei ⇒ String
Device ids.
-
#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.
Methods inherited from BaseModel
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.
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/verizon/models/session_report_request.rb', line 70 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
Account Number.
14 15 16 |
# File 'lib/verizon/models/session_report_request.rb', line 14 def account_number @account_number end |
#duration_high ⇒ Integer
The High value of session duration.
38 39 40 |
# File 'lib/verizon/models/session_report_request.rb', line 38 def duration_high @duration_high end |
#duration_low ⇒ Integer
The Low value of session duration.
34 35 36 |
# File 'lib/verizon/models/session_report_request.rb', line 34 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.
30 31 32 |
# File 'lib/verizon/models/session_report_request.rb', line 30 def end_date @end_date end |
#imei ⇒ String
Device ids.
18 19 20 |
# File 'lib/verizon/models/session_report_request.rb', line 18 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.
24 25 26 |
# File 'lib/verizon/models/session_report_request.rb', line 24 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/verizon/models/session_report_request.rb', line 85 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.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/verizon/models/session_report_request.rb', line 41 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
63 64 65 66 67 68 |
# File 'lib/verizon/models/session_report_request.rb', line 63 def self.nullables %w[ duration_low duration_high ] end |
.optionals ⇒ Object
An array for optional fields
53 54 55 56 57 58 59 60 |
# File 'lib/verizon/models/session_report_request.rb', line 53 def self.optionals %w[ start_date end_date duration_low duration_high ] end |