Class: AdvancedBilling::SubscriptionGroupPrepayment

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/advanced_billing/models/subscription_group_prepayment.rb

Overview

SubscriptionGroupPrepayment Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(amount:, details:, memo:, method:, additional_properties: {}) ⇒ SubscriptionGroupPrepayment

Returns a new instance of SubscriptionGroupPrepayment.



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 48

def initialize(amount:, details:, memo:, method:, additional_properties: {})
  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end

  @amount = amount
  @details = details
  @memo = memo
  @method = method
end

Instance Attribute Details

#amountInteger

TODO: Write general description for this method

Returns:

  • (Integer)


14
15
16
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 14

def amount
  @amount
end

#detailsString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 18

def details
  @details
end

#memoString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 22

def memo
  @memo
end

#methodSubscriptionGroupPrepaymentMethod

TODO: Write general description for this method



26
27
28
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 26

def method
  @method
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  amount = hash.key?('amount') ? hash['amount'] : nil
  details = hash.key?('details') ? hash['details'] : nil
  memo = hash.key?('memo') ? hash['memo'] : nil
  method = hash.key?('method') ? hash['method'] : nil

  # Clean out expected properties from Hash.
  additional_properties = hash.reject { |k, _| names.value?(k) }

  # Create object from extracted values.
  SubscriptionGroupPrepayment.new(amount: amount,
                                  details: details,
                                  memo: memo,
                                  method: method,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['amount'] = 'amount'
  @_hash['details'] = 'details'
  @_hash['memo'] = 'memo'
  @_hash['method'] = 'method'
  @_hash
end

.nullablesObject

An array for nullable fields



44
45
46
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 44

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
# File 'lib/advanced_billing/models/subscription_group_prepayment.rb', line 39

def self.optionals
  []
end