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:, latest:, device_id: SKIP, label: SKIP, additional_properties: nil) ⇒ DeviceUsageListRequest
constructor
A new instance of DeviceUsageListRequest.
-
#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(earliest:, latest:, device_id: SKIP, label: SKIP, additional_properties: nil) ⇒ DeviceUsageListRequest
Returns a new instance of DeviceUsageListRequest.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 52 def initialize(earliest:, latest:, device_id: SKIP, label: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @earliest = earliest @latest = latest @device_id = device_id unless device_id == SKIP @label = label unless label == SKIP @additional_properties = additional_properties 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.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 65 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 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. DeviceUsageListRequest.new(earliest: earliest, latest: latest, device_id: device_id, label: label, additional_properties: additional_properties) 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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
97 98 99 100 101 102 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 97 def inspect class_name = self.class.name.split('::').last "<#{class_name} earliest: #{@earliest.inspect}, latest: #{@latest.inspect}, device_id:"\ " #{@device_id.inspect}, label: #{@label.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
90 91 92 93 94 |
# File 'lib/verizon/models/device_usage_list_request.rb', line 90 def to_s class_name = self.class.name.split('::').last "<#{class_name} earliest: #{@earliest}, latest: #{@latest}, device_id: #{@device_id},"\ " label: #{@label}, additional_properties: #{@additional_properties}>" end |