Class: Verizon::DeviceAggregateUsageListRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::DeviceAggregateUsageListRequest
- Defined in:
- lib/verizon/models/device_aggregate_usage_list_request.rb
Overview
Request to list device aggregate usage.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name of a billing account.
-
#device_ids ⇒ Array[DeviceId]
One or more devices for which you want aggregate data, specified by device ID.
-
#end_time ⇒ String
The end of the reporting period.
-
#group_name ⇒ String
The name of a device group, if you want to only include devices in that group.
-
#label ⇒ Array[Label]
The name of a device group, if you want to only include devices in that group.
-
#start_time ⇒ String
The beginning of the reporting period.
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(start_time = nil, end_time = nil, device_ids = SKIP, account_name = SKIP, group_name = SKIP, label = SKIP) ⇒ DeviceAggregateUsageListRequest
constructor
A new instance of DeviceAggregateUsageListRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(start_time = nil, end_time = nil, device_ids = SKIP, account_name = SKIP, group_name = SKIP, label = SKIP) ⇒ DeviceAggregateUsageListRequest
Returns a new instance of DeviceAggregateUsageListRequest.
68 69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 68 def initialize(start_time = nil, end_time = nil, device_ids = SKIP, account_name = SKIP, group_name = SKIP, label = SKIP) @start_time = start_time @end_time = end_time @device_ids = device_ids unless device_ids == SKIP @account_name = account_name unless account_name == SKIP @group_name = group_name unless group_name == SKIP @label = label unless label == SKIP end |
Instance Attribute Details
#account_name ⇒ String
The name of a billing account.
29 30 31 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 29 def account_name @account_name end |
#device_ids ⇒ Array[DeviceId]
One or more devices for which you want aggregate data, specified by device ID.
25 26 27 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 25 def device_ids @device_ids end |
#end_time ⇒ String
The end of the reporting period. The endTime date must be within on month of the startTime date.
20 21 22 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 20 def end_time @end_time end |
#group_name ⇒ String
The name of a device group, if you want to only include devices in that group.
34 35 36 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 34 def group_name @group_name end |
#label ⇒ Array[Label]
The name of a device group, if you want to only include devices in that group.
39 40 41 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 39 def label @label end |
#start_time ⇒ String
The beginning of the reporting period. The startTime cannot be more than 6 months before the current date.
15 16 17 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 15 def start_time @start_time end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. start_time = hash.key?('startTime') ? hash['startTime'] : nil end_time = hash.key?('endTime') ? hash['endTime'] : nil # Parameter is an array, so we need to iterate through it device_ids = nil unless hash['deviceIds'].nil? device_ids = [] hash['deviceIds'].each do |structure| device_ids << (DeviceId.from_hash(structure) if structure) end end device_ids = SKIP unless hash.key?('deviceIds') account_name = hash.key?('accountName') ? hash['accountName'] : SKIP group_name = hash.key?('groupName') ? hash['groupName'] : SKIP # Parameter is an array, so we need to iterate through it label = nil unless hash['label'].nil? label = [] hash['label'].each do |structure| label << (Label.from_hash(structure) if structure) end end label = SKIP unless hash.key?('label') # Create object from extracted values. DeviceAggregateUsageListRequest.new(start_time, end_time, device_ids, account_name, group_name, label) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['start_time'] = 'startTime' @_hash['end_time'] = 'endTime' @_hash['device_ids'] = 'deviceIds' @_hash['account_name'] = 'accountName' @_hash['group_name'] = 'groupName' @_hash['label'] = 'label' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 54 def self.optionals %w[ device_ids account_name group_name label ] end |