Class: AdvancedBilling::SubscriptionGroupSignupError

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

Overview

SubscriptionGroupSignupError 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(subscriptions: SKIP, payer_reference: SKIP, payer: SKIP, subscription_group: SKIP, payment_profile_id: SKIP, payer_id: SKIP, additional_properties: {}) ⇒ SubscriptionGroupSignupError

Returns a new instance of SubscriptionGroupSignupError.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 71

def initialize(subscriptions: SKIP, payer_reference: SKIP, payer: SKIP,
               subscription_group: SKIP, payment_profile_id: SKIP,
               payer_id: SKIP, additional_properties: {})
  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end

  @subscriptions = subscriptions unless subscriptions == SKIP
  @payer_reference = payer_reference unless payer_reference == SKIP
  @payer = payer unless payer == SKIP
  @subscription_group = subscription_group unless subscription_group == SKIP
  @payment_profile_id = payment_profile_id unless payment_profile_id == SKIP
  @payer_id = payer_id unless payer_id == SKIP
end

Instance Attribute Details

#payerPayerError

Object that as key have subscription position in request subscriptions array and as value subscription errors object.

Returns:



25
26
27
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 25

def payer
  @payer
end

#payer_idString

Object that as key have subscription position in request subscriptions array and as value subscription errors object.

Returns:

  • (String)


40
41
42
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 40

def payer_id
  @payer_id
end

#payer_referenceString

Object that as key have subscription position in request subscriptions array and as value subscription errors object.

Returns:

  • (String)


20
21
22
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 20

def payer_reference
  @payer_reference
end

#payment_profile_idString

Object that as key have subscription position in request subscriptions array and as value subscription errors object.

Returns:

  • (String)


35
36
37
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 35

def payment_profile_id
  @payment_profile_id
end

#subscription_groupArray[String]

Object that as key have subscription position in request subscriptions array and as value subscription errors object.

Returns:

  • (Array[String])


30
31
32
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 30

def subscription_group
  @subscription_group
end

#subscriptionsHash[String, SubscriptionGroupSubscriptionError]

Object that as key have subscription position in request subscriptions array and as value subscription errors object.

Returns:



15
16
17
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 15

def subscriptions
  @subscriptions
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 88

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  subscriptions = SubscriptionGroupSubscriptionError.from_hash(hash['subscriptions']) if
    hash['subscriptions']

  subscriptions = SKIP unless hash.key?('subscriptions')
  payer_reference =
    hash.key?('payer_reference') ? hash['payer_reference'] : SKIP
  payer = PayerError.from_hash(hash['payer']) if hash['payer']
  subscription_group =
    hash.key?('subscription_group') ? hash['subscription_group'] : SKIP
  payment_profile_id =
    hash.key?('payment_profile_id') ? hash['payment_profile_id'] : SKIP
  payer_id = hash.key?('payer_id') ? hash['payer_id'] : SKIP

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

  # Create object from extracted values.
  SubscriptionGroupSignupError.new(subscriptions: subscriptions,
                                   payer_reference: payer_reference,
                                   payer: payer,
                                   subscription_group: subscription_group,
                                   payment_profile_id: payment_profile_id,
                                   payer_id: payer_id,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
50
51
52
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['subscriptions'] = 'subscriptions'
  @_hash['payer_reference'] = 'payer_reference'
  @_hash['payer'] = 'payer'
  @_hash['subscription_group'] = 'subscription_group'
  @_hash['payment_profile_id'] = 'payment_profile_id'
  @_hash['payer_id'] = 'payer_id'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



55
56
57
58
59
60
61
62
63
64
# File 'lib/advanced_billing/models/subscription_group_signup_error.rb', line 55

def self.optionals
  %w[
    subscriptions
    payer_reference
    payer
    subscription_group
    payment_profile_id
    payer_id
  ]
end