Class: Verizon::BillUsageRequest
- Defined in:
- lib/verizon/models/bill_usage_request.rb
Overview
Bill usage request.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account identifier.
-
#end_date ⇒ String
End date to search for billable usage, mm-dd-yyyy.
-
#start_date ⇒ String
Start date to search for billable usage, mm-dd-yyyy.
-
#usage_for_all_accounts ⇒ TrueClass | FalseClass
Request usage for single or multiple accounts.
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(account_name = nil, start_date = nil, end_date = nil, usage_for_all_accounts = SKIP) ⇒ BillUsageRequest
constructor
A new instance of BillUsageRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, start_date = nil, end_date = nil, usage_for_all_accounts = SKIP) ⇒ BillUsageRequest
Returns a new instance of BillUsageRequest.
50 51 52 53 54 55 56 |
# File 'lib/verizon/models/bill_usage_request.rb', line 50 def initialize(account_name = nil, start_date = nil, end_date = nil, usage_for_all_accounts = SKIP) @account_name = account_name @start_date = start_date @end_date = end_date @usage_for_all_accounts = usage_for_all_accounts unless usage_for_all_accounts == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account identifier.
14 15 16 |
# File 'lib/verizon/models/bill_usage_request.rb', line 14 def account_name @account_name end |
#end_date ⇒ String
End date to search for billable usage, mm-dd-yyyy.
22 23 24 |
# File 'lib/verizon/models/bill_usage_request.rb', line 22 def end_date @end_date end |
#start_date ⇒ String
Start date to search for billable usage, mm-dd-yyyy.
18 19 20 |
# File 'lib/verizon/models/bill_usage_request.rb', line 18 def start_date @start_date end |
#usage_for_all_accounts ⇒ TrueClass | FalseClass
Request usage for single or multiple accounts.
26 27 28 |
# File 'lib/verizon/models/bill_usage_request.rb', line 26 def usage_for_all_accounts @usage_for_all_accounts end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/verizon/models/bill_usage_request.rb', line 59 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil start_date = hash.key?('startDate') ? hash['startDate'] : nil end_date = hash.key?('endDate') ? hash['endDate'] : nil usage_for_all_accounts = hash.key?('usageForAllAccounts') ? hash['usageForAllAccounts'] : SKIP # Create object from extracted values. BillUsageRequest.new(account_name, start_date, end_date, usage_for_all_accounts) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/verizon/models/bill_usage_request.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['start_date'] = 'startDate' @_hash['end_date'] = 'endDate' @_hash['usage_for_all_accounts'] = 'usageForAllAccounts' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/verizon/models/bill_usage_request.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 |
# File 'lib/verizon/models/bill_usage_request.rb', line 39 def self.optionals %w[ usage_for_all_accounts ] end |