Class: Verizon::DeviceUsageListRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::DeviceUsageListRequest
- Defined in:
- lib/verizon/models/device_usage_list_request.rb
Overview
Request to return the daily network data usage of a single device during a specified time period.
Instance Attribute Summary collapse
-
#device_id ⇒ DeviceId
An identifier for a single device.
-
#earliest ⇒ String
The earliest date for which you want usage data.
-
#label ⇒ Label
An identifier for a single device.
-
#latest ⇒ String
The last date for which you want usage data.
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(earliest = nil, latest = nil, device_id = SKIP, label = SKIP) ⇒ DeviceUsageListRequest
constructor
A new instance of DeviceUsageListRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(earliest = nil, latest = nil, device_id = SKIP, label = SKIP) ⇒ DeviceUsageListRequest
Returns a new instance of DeviceUsageListRequest.
52 53 54 55 56 57 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 52 def initialize(earliest = nil, latest = nil, device_id = SKIP, label = SKIP) @earliest = earliest @latest = latest @device_id = device_id unless device_id == SKIP @label = label unless label == SKIP end |
Instance Attribute Details
#device_id ⇒ DeviceId
An identifier for a single device.
23 24 25 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 23 def device_id @device_id end |
#earliest ⇒ String
The earliest date for which you want usage data.
15 16 17 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 15 def earliest @earliest end |
#label ⇒ Label
An identifier for a single device.
27 28 29 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 27 def label @label end |
#latest ⇒ String
The last date for which you want usage data.
19 20 21 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 19 def latest @latest end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. earliest = hash.key?('earliest') ? hash['earliest'] : nil latest = hash.key?('latest') ? hash['latest'] : nil device_id = DeviceId.from_hash(hash['deviceId']) if hash['deviceId'] label = Label.from_hash(hash['label']) if hash['label'] # Create object from extracted values. DeviceUsageListRequest.new(earliest, latest, device_id, label) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['earliest'] = 'earliest' @_hash['latest'] = 'latest' @_hash['device_id'] = 'deviceId' @_hash['label'] = 'label' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 40 def self.optionals %w[ device_id label ] end |