Class: AdvancedBilling::CreateInvoicePaymentRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::CreateInvoicePaymentRequest
- Defined in:
- lib/advanced_billing/models/create_invoice_payment_request.rb
Overview
CreateInvoicePaymentRequest Model.
Instance Attribute Summary collapse
-
#payment ⇒ CreateInvoicePayment
TODO: Write general description for this method.
-
#type ⇒ InvoicePaymentType
The type of payment to be applied to an Invoice.
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(payment = nil, type = InvoicePaymentType::EXTERNAL) ⇒ CreateInvoicePaymentRequest
constructor
A new instance of CreateInvoicePaymentRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(payment = nil, type = InvoicePaymentType::EXTERNAL) ⇒ CreateInvoicePaymentRequest
Returns a new instance of CreateInvoicePaymentRequest.
40 41 42 43 |
# File 'lib/advanced_billing/models/create_invoice_payment_request.rb', line 40 def initialize(payment = nil, type = InvoicePaymentType::EXTERNAL) @payment = payment @type = type unless type == SKIP end |
Instance Attribute Details
#payment ⇒ CreateInvoicePayment
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/create_invoice_payment_request.rb', line 14 def payment @payment end |
#type ⇒ InvoicePaymentType
The type of payment to be applied to an Invoice.
18 19 20 |
# File 'lib/advanced_billing/models/create_invoice_payment_request.rb', line 18 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/advanced_billing/models/create_invoice_payment_request.rb', line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payment = CreateInvoicePayment.from_hash(hash['payment']) if hash['payment'] type = hash['type'] ||= InvoicePaymentType::EXTERNAL # Create object from extracted values. CreateInvoicePaymentRequest.new(payment, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/advanced_billing/models/create_invoice_payment_request.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['payment'] = 'payment' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/advanced_billing/models/create_invoice_payment_request.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 |
# File 'lib/advanced_billing/models/create_invoice_payment_request.rb', line 29 def self.optionals %w[ type ] end |