Class: AdvancedBilling::SubscriptionGroupPrepaymentResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SubscriptionGroupPrepaymentResponse
- Defined in:
- lib/advanced_billing/models/subscription_group_prepayment_response.rb
Overview
SubscriptionGroupPrepaymentResponse Model.
Instance Attribute Summary collapse
-
#amount_in_cents ⇒ Integer
The amount in cents of the entry.
-
#ending_balance_in_cents ⇒ Integer
The ending balance in cents of the account.
-
#entry_type ⇒ ServiceCreditType
The type of entry.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#memo ⇒ String
A memo attached to the entry.
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(id: SKIP, amount_in_cents: SKIP, ending_balance_in_cents: SKIP, entry_type: SKIP, memo: SKIP, additional_properties: {}) ⇒ SubscriptionGroupPrepaymentResponse
constructor
A new instance of SubscriptionGroupPrepaymentResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(id: SKIP, amount_in_cents: SKIP, ending_balance_in_cents: SKIP, entry_type: SKIP, memo: SKIP, additional_properties: {}) ⇒ SubscriptionGroupPrepaymentResponse
Returns a new instance of SubscriptionGroupPrepaymentResponse.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 61 def initialize(id: SKIP, amount_in_cents: SKIP, ending_balance_in_cents: SKIP, entry_type: SKIP, memo: SKIP, additional_properties: {}) @id = id unless id == SKIP @amount_in_cents = amount_in_cents unless amount_in_cents == SKIP @ending_balance_in_cents = ending_balance_in_cents unless ending_balance_in_cents == SKIP @entry_type = entry_type unless entry_type == SKIP @memo = memo unless memo == SKIP # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end end |
Instance Attribute Details
#amount_in_cents ⇒ Integer
The amount in cents of the entry.
18 19 20 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 18 def amount_in_cents @amount_in_cents end |
#ending_balance_in_cents ⇒ Integer
The ending balance in cents of the account.
22 23 24 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 22 def ending_balance_in_cents @ending_balance_in_cents end |
#entry_type ⇒ ServiceCreditType
The type of entry
26 27 28 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 26 def entry_type @entry_type end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 14 def id @id end |
#memo ⇒ String
A memo attached to the entry.
30 31 32 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 30 def memo @memo end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP amount_in_cents = hash.key?('amount_in_cents') ? hash['amount_in_cents'] : SKIP ending_balance_in_cents = hash.key?('ending_balance_in_cents') ? hash['ending_balance_in_cents'] : SKIP entry_type = hash.key?('entry_type') ? hash['entry_type'] : SKIP memo = hash.key?('memo') ? hash['memo'] : SKIP # Clean out expected properties from Hash. names.each_value { |k| hash.delete(k) } # Create object from extracted values. SubscriptionGroupPrepaymentResponse.new(id: id, amount_in_cents: amount_in_cents, ending_balance_in_cents: ending_balance_in_cents, entry_type: entry_type, memo: memo, additional_properties: hash) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['amount_in_cents'] = 'amount_in_cents' @_hash['ending_balance_in_cents'] = 'ending_balance_in_cents' @_hash['entry_type'] = 'entry_type' @_hash['memo'] = 'memo' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 58 59 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 55 def self.nullables %w[ memo ] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/advanced_billing/models/subscription_group_prepayment_response.rb', line 44 def self.optionals %w[ id amount_in_cents ending_balance_in_cents entry_type memo ] end |