Class: Verizon::AggregateSessionReportRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/aggregate_session_report_request.rb

Overview

Request for getting an aggregated session report.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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( = nil, imei = nil, start_date = SKIP,
               end_date = SKIP, device_group = SKIP, device_label = SKIP,
               data_plan = SKIP, no_session_flag = SKIP)
  @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_numberString

The unique identifier for the account.

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 14

def 
  @account_number
end

#data_planString

The data plan the devices beign queried belong to.

Returns:

  • (String)


44
45
46
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 44

def data_plan
  @data_plan
end

#device_groupString

User defined group name the devices are a member of.

Returns:

  • (String)


36
37
38
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 36

def device_group
  @device_group
end

#device_labelString

Optional filter parameter.

Returns:

  • (String)


40
41
42
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 40

def device_label
  @device_label
end

#end_dateString

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.

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 26

def end_date
  @end_date
end

#imeiArray[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).

Returns:

  • (Array[String])


32
33
34
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 32

def imei
  @imei
end

#no_session_flagString

Optional filter parameter which return only devices with no sessions.

Returns:

  • (String)


48
49
50
# File 'lib/verizon/models/aggregate_session_report_request.rb', line 48

def no_session_flag
  @no_session_flag
end

#start_dateString

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.

Returns:

  • (String)


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.
   = 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(,
                                    imei,
                                    start_date,
                                    end_date,
                                    device_group,
                                    device_label,
                                    data_plan,
                                    no_session_flag)
end

.namesObject

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

.nullablesObject

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

.optionalsObject

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