Class: Verizon::SessionReportRequest

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

Overview

Request for obtaining a 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, 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( = nil,
               imei = nil,
               start_date = SKIP,
               end_date = SKIP,
               duration_low = SKIP,
               duration_high = SKIP)
  @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_numberString

Account Number.

Returns:

  • (String)


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

def 
  @account_number
end

#duration_highInteger

The High value of session duration.

Returns:

  • (Integer)


38
39
40
# File 'lib/verizon/models/session_report_request.rb', line 38

def duration_high
  @duration_high
end

#duration_lowInteger

The Low value of session duration.

Returns:

  • (Integer)


34
35
36
# File 'lib/verizon/models/session_report_request.rb', line 34

def duration_low
  @duration_low
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)


30
31
32
# File 'lib/verizon/models/session_report_request.rb', line 30

def end_date
  @end_date
end

#imeiString

Device ids.

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/session_report_request.rb', line 18

def imei
  @imei
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)


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.
   = 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(,
                           imei,
                           start_date,
                           end_date,
                           duration_low,
                           duration_high)
end

.namesObject

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

.nullablesObject

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

.optionalsObject

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