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:, end_time:, device_ids: SKIP, account_name: SKIP, group_name: SKIP, label: SKIP, additional_properties: nil) ⇒ DeviceAggregateUsageListRequest
constructor
A new instance of DeviceAggregateUsageListRequest.
-
#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(start_time:, end_time:, device_ids: SKIP, account_name: SKIP, group_name: SKIP, label: SKIP, additional_properties: nil) ⇒ DeviceAggregateUsageListRequest
Returns a new instance of DeviceAggregateUsageListRequest.
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 68 def initialize(start_time:, end_time:, device_ids: SKIP, account_name: SKIP, group_name: SKIP, label: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @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 @additional_properties = additional_properties 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.
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 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 83 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 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. DeviceAggregateUsageListRequest.new(start_time: start_time, end_time: end_time, device_ids: device_ids, account_name: account_name, group_name: group_name, label: label, additional_properties: additional_properties) 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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
138 139 140 141 142 143 144 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 138 def inspect class_name = self.class.name.split('::').last "<#{class_name} start_time: #{@start_time.inspect}, end_time: #{@end_time.inspect},"\ " device_ids: #{@device_ids.inspect}, account_name: #{@account_name.inspect}, group_name:"\ " #{@group_name.inspect}, label: #{@label.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
130 131 132 133 134 135 |
# File 'lib/verizon/models/device_aggregate_usage_list_request.rb', line 130 def to_s class_name = self.class.name.split('::').last "<#{class_name} start_time: #{@start_time}, end_time: #{@end_time}, device_ids:"\ " #{@device_ids}, account_name: #{@account_name}, group_name: #{@group_name}, label:"\ " #{@label}, additional_properties: #{@additional_properties}>" end |