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 ⇒ HplAccountnumber
The numeric ID of the account and must include leading zeroes.
-
#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:, imei:, start_date: SKIP, end_date: SKIP, device_group: SKIP, device_label: SKIP, data_plan: SKIP, no_session_flag: SKIP, additional_properties: nil) ⇒ AggregateSessionReportRequest
constructor
A new instance of AggregateSessionReportRequest.
-
#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:, imei:, start_date: SKIP, end_date: SKIP, device_group: SKIP, device_label: SKIP, data_plan: SKIP, no_session_flag: SKIP, additional_properties: nil) ⇒ AggregateSessionReportRequest
Returns a new instance of AggregateSessionReportRequest.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 86 def initialize(account_number:, imei:, start_date: SKIP, end_date: SKIP, device_group: SKIP, device_label: SKIP, data_plan: SKIP, no_session_flag: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @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 @additional_properties = additional_properties end |
Instance Attribute Details
#account_number ⇒ HplAccountnumber
The numeric ID of the account and must include leading zeroes. This value is indentical to ‘accountName`.
15 16 17 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 15 def account_number @account_number end |
#data_plan ⇒ String
The data plan the devices beign queried belong to.
45 46 47 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 45 def data_plan @data_plan end |
#device_group ⇒ String
User defined group name the devices are a member of.
37 38 39 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 37 def device_group @device_group end |
#device_label ⇒ String
Optional filter parameter.
41 42 43 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 41 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.
27 28 29 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 27 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).
33 34 35 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 33 def imei @imei end |
#no_session_flag ⇒ String
Optional filter parameter which return only devices with no sessions.
49 50 51 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 49 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.
21 22 23 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 21 def start_date @start_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 104 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_number = HplAccountnumber.from_hash(hash['accountNumber']) if hash['accountNumber'] 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 a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AggregateSessionReportRequest.new(account_number: account_number, imei: imei, start_date: start_date, end_date: end_date, device_group: device_group, device_label: device_label, data_plan: data_plan, no_session_flag: no_session_flag, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 52 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
78 79 80 81 82 83 84 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 78 def self.nullables %w[ device_group device_label data_plan ] end |
.optionals ⇒ Object
An array for optional fields
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 66 def self.optionals %w[ start_date end_date device_group device_label data_plan no_session_flag ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
147 148 149 150 151 152 153 154 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 147 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number.inspect}, start_date:"\ " #{@start_date.inspect}, end_date: #{@end_date.inspect}, imei: #{@imei.inspect},"\ " device_group: #{@device_group.inspect}, device_label: #{@device_label.inspect}, data_plan:"\ " #{@data_plan.inspect}, no_session_flag: #{@no_session_flag.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
138 139 140 141 142 143 144 |
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 138 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_number: #{@account_number}, start_date: #{@start_date}, end_date:"\ " #{@end_date}, imei: #{@imei}, device_group: #{@device_group}, device_label:"\ " #{@device_label}, data_plan: #{@data_plan}, no_session_flag: #{@no_session_flag},"\ " additional_properties: #{@additional_properties}>" end |