Class: AdvancedBilling::CreditAccountBalanceChanged
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::CreditAccountBalanceChanged
- Defined in:
- lib/advanced_billing/models/credit_account_balance_changed.rb
Overview
CreditAccountBalanceChanged Model.
Instance Attribute Summary collapse
-
#at_time ⇒ String
TODO: Write general description for this method.
-
#currency_code ⇒ String
TODO: Write general description for this method.
-
#reason ⇒ String
TODO: Write general description for this method.
-
#service_credit_account_balance_in_cents ⇒ Integer
TODO: Write general description for this method.
-
#service_credit_balance_change_in_cents ⇒ Integer
TODO: Write general description for this method.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(reason = nil, service_credit_account_balance_in_cents = nil, service_credit_balance_change_in_cents = nil, currency_code = nil, at_time = nil) ⇒ CreditAccountBalanceChanged
constructor
A new instance of CreditAccountBalanceChanged.
Methods inherited from BaseModel
Constructor Details
#initialize(reason = nil, service_credit_account_balance_in_cents = nil, service_credit_balance_change_in_cents = nil, currency_code = nil, at_time = nil) ⇒ CreditAccountBalanceChanged
Returns a new instance of CreditAccountBalanceChanged.
55 56 57 58 59 60 61 62 63 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 55 def initialize(reason = nil, service_credit_account_balance_in_cents = nil, service_credit_balance_change_in_cents = nil, currency_code = nil, at_time = nil) @reason = reason @service_credit_account_balance_in_cents = service_credit_account_balance_in_cents @service_credit_balance_change_in_cents = service_credit_balance_change_in_cents @currency_code = currency_code @at_time = at_time end |
Instance Attribute Details
#at_time ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 30 def at_time @at_time end |
#currency_code ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 26 def currency_code @currency_code end |
#reason ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 14 def reason @reason end |
#service_credit_account_balance_in_cents ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 18 def service_credit_account_balance_in_cents @service_credit_account_balance_in_cents end |
#service_credit_balance_change_in_cents ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 22 def service_credit_balance_change_in_cents @service_credit_balance_change_in_cents end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reason = hash.key?('reason') ? hash['reason'] : nil service_credit_account_balance_in_cents = hash.key?('service_credit_account_balance_in_cents') ? hash['service_credit_account_balance_in_cents'] : nil service_credit_balance_change_in_cents = hash.key?('service_credit_balance_change_in_cents') ? hash['service_credit_balance_change_in_cents'] : nil currency_code = hash.key?('currency_code') ? hash['currency_code'] : nil at_time = hash.key?('at_time') ? hash['at_time'] : nil # Create object from extracted values. CreditAccountBalanceChanged.new(reason, service_credit_account_balance_in_cents, service_credit_balance_change_in_cents, currency_code, at_time) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['reason'] = 'reason' @_hash['service_credit_account_balance_in_cents'] = 'service_credit_account_balance_in_cents' @_hash['service_credit_balance_change_in_cents'] = 'service_credit_balance_change_in_cents' @_hash['currency_code'] = 'currency_code' @_hash['at_time'] = 'at_time' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 46 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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 |
# File 'lib/advanced_billing/models/credit_account_balance_changed.rb', line 88 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.reason, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.service_credit_account_balance_in_cents, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.service_credit_balance_change_in_cents, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.currency_code, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.at_time, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['reason'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['service_credit_account_balance_in_cents'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['service_credit_balance_change_in_cents'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['currency_code'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['at_time'], ->(val) { val.instance_of? String }) ) end |