Class: Verizon::AggregateSessionReportRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::AggregateSessionReportRequest
- Defined in:
- lib/verizon/models/aggregate_session_report_request.rb
Overview
Request for getting an aggregated session report.
Instance Attribute Summary collapse
-
#account_number ⇒ String
The unique identifier for the account.
-
#data_plan ⇒ String
The data plan the devices beign queried belong to.
-
#device_group ⇒ String
User defined group name the devices are a member of.
-
#device_label ⇒ String
Optional filter parameter.
-
#end_date ⇒ String
End date of session to include.
-
#imei ⇒ Array[String]
Devices for which return usage info.
-
#no_session_flag ⇒ String
Optional filter parameter which return only devices with no sessions.
-
#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, device_group = SKIP, device_label = SKIP, data_plan = SKIP, no_session_flag = SKIP) ⇒ AggregateSessionReportRequest
constructor
A new instance of AggregateSessionReportRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_number = nil, imei = nil, start_date = SKIP, end_date = SKIP, device_group = SKIP, device_label = SKIP, data_plan = SKIP, no_session_flag = SKIP) ⇒ AggregateSessionReportRequest
Returns a new instance of AggregateSessionReportRequest.
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 85 def initialize(account_number = nil, imei = nil, start_date = SKIP, end_date = SKIP, device_group = SKIP, device_label = SKIP, data_plan = SKIP, no_session_flag = SKIP) @account_number = account_number @start_date = start_date unless start_date == SKIP @end_date = end_date unless end_date == SKIP @imei = imei @device_group = device_group unless device_group == SKIP @device_label = device_label unless device_label == SKIP @data_plan = data_plan unless data_plan == SKIP @no_session_flag = no_session_flag unless no_session_flag == SKIP end |
Instance Attribute Details
#account_number ⇒ String
The unique identifier for the account.
14 15 16 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 14 def account_number @account_number end |
#data_plan ⇒ String
The data plan the devices beign queried belong to.
44 45 46 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 44 def data_plan @data_plan end |
#device_group ⇒ String
User defined group name the devices are a member of.
36 37 38 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 36 def device_group @device_group end |
#device_label ⇒ String
Optional filter parameter.
40 41 42 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 40 def device_label @device_label 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.
26 27 28 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 26 def end_date @end_date end |
#imei ⇒ Array[String]
Devices for which return usage info. Could be 0, 1 or more. In case of 0 will return all devices belonging to customer (except of filtered by other parameters).
32 33 34 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 32 def imei @imei end |
#no_session_flag ⇒ String
Optional filter parameter which return only devices with no sessions.
48 49 50 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 48 def no_session_flag @no_session_flag 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.
20 21 22 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 20 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 99 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 device_group = hash.key?('deviceGroup') ? hash['deviceGroup'] : SKIP device_label = hash.key?('deviceLabel') ? hash['deviceLabel'] : SKIP data_plan = hash.key?('dataPlan') ? hash['dataPlan'] : SKIP no_session_flag = hash.key?('noSessionFlag') ? hash['noSessionFlag'] : SKIP # Create object from extracted values. AggregateSessionReportRequest.new(account_number, imei, start_date, end_date, device_group, device_label, data_plan, no_session_flag) end |
.names ⇒ Object
A mapping from model property names to API property names.
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 51 def self.names @_hash = {} if @_hash.nil? @_hash['account_number'] = 'accountNumber' @_hash['start_date'] = 'startDate' @_hash['end_date'] = 'endDate' @_hash['imei'] = 'imei' @_hash['device_group'] = 'deviceGroup' @_hash['device_label'] = 'deviceLabel' @_hash['data_plan'] = 'dataPlan' @_hash['no_session_flag'] = 'noSessionFlag' @_hash end |
.nullables ⇒ Object
An array for nullable fields
77 78 79 80 81 82 83 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 77 def self.nullables %w[ device_group device_label data_plan ] end |
.optionals ⇒ Object
An array for optional fields
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 65 def self.optionals %w[ start_date end_date device_group device_label data_plan no_session_flag ] end |