Class: AdvancedBilling::SubscriptionGroupSubscriptionError

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

Overview

Object which contains subscription errors.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(product = SKIP, product_price_point_id = SKIP, payment_profile = SKIP, payment_profile_chargify_token = SKIP) ⇒ SubscriptionGroupSubscriptionError

Returns a new instance of SubscriptionGroupSubscriptionError.



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

def initialize(product = SKIP, product_price_point_id = SKIP,
               payment_profile = SKIP,
               payment_profile_chargify_token = SKIP)
  @product = product unless product == SKIP
  @product_price_point_id = product_price_point_id unless product_price_point_id == SKIP
  @payment_profile = payment_profile unless payment_profile == SKIP
  unless payment_profile_chargify_token == SKIP
    @payment_profile_chargify_token =
      payment_profile_chargify_token
  end
end

Instance Attribute Details

#payment_profileArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def payment_profile
  @payment_profile
end

#payment_profile_chargify_tokenArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def payment_profile_chargify_token
  @payment_profile_chargify_token
end

#productArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def product
  @product
end

#product_price_point_idArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


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

def product_price_point_id
  @product_price_point_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/advanced_billing/models/subscription_group_subscription_error.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  product = hash.key?('product') ? hash['product'] : SKIP
  product_price_point_id =
    hash.key?('product_price_point_id') ? hash['product_price_point_id'] : SKIP
  payment_profile =
    hash.key?('payment_profile') ? hash['payment_profile'] : SKIP
  payment_profile_chargify_token =
    hash.key?('payment_profile.chargify_token') ? hash['payment_profile.chargify_token'] : SKIP

  # Create object from extracted values.
  SubscriptionGroupSubscriptionError.new(product,
                                         product_price_point_id,
                                         payment_profile,
                                         payment_profile_chargify_token)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['product'] = 'product'
  @_hash['product_price_point_id'] = 'product_price_point_id'
  @_hash['payment_profile'] = 'payment_profile'
  @_hash['payment_profile_chargify_token'] =
    'payment_profile.chargify_token'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/advanced_billing/models/subscription_group_subscription_error.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/advanced_billing/models/subscription_group_subscription_error.rb', line 40

def self.optionals
  %w[
    product
    product_price_point_id
    payment_profile
    payment_profile_chargify_token
  ]
end