maxio-advanced-billing-sdk 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -40
  3. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +6 -4
  4. data/lib/advanced_billing/controllers/base_controller.rb +1 -1
  5. data/lib/advanced_billing/controllers/components_controller.rb +9 -58
  6. data/lib/advanced_billing/controllers/coupons_controller.rb +6 -115
  7. data/lib/advanced_billing/controllers/custom_fields_controller.rb +4 -4
  8. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +5 -22
  9. data/lib/advanced_billing/controllers/insights_controller.rb +3 -4
  10. data/lib/advanced_billing/controllers/invoices_controller.rb +11 -0
  11. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +26 -0
  12. data/lib/advanced_billing/controllers/product_families_controller.rb +5 -14
  13. data/lib/advanced_billing/controllers/product_price_points_controller.rb +3 -40
  14. data/lib/advanced_billing/controllers/products_controller.rb +5 -14
  15. data/lib/advanced_billing/controllers/subscription_components_controller.rb +16 -66
  16. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +5 -15
  17. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +6 -6
  18. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +13 -20
  19. data/lib/advanced_billing/controllers/subscriptions_controller.rb +49 -14
  20. data/lib/advanced_billing/models/ach_agreement.rb +10 -0
  21. data/lib/advanced_billing/models/address_change.rb +0 -22
  22. data/lib/advanced_billing/models/agreement_acceptance.rb +10 -0
  23. data/lib/advanced_billing/models/allocation.rb +1 -3
  24. data/lib/advanced_billing/models/applied_credit_note_data.rb +10 -0
  25. data/lib/advanced_billing/models/apply_credit_note_event.rb +139 -0
  26. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +3 -1
  27. data/lib/advanced_billing/models/apply_debit_note_event.rb +139 -0
  28. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +36 -2
  29. data/lib/advanced_billing/models/apply_payment_event.rb +139 -0
  30. data/lib/advanced_billing/models/apply_payment_event_data.rb +21 -7
  31. data/lib/advanced_billing/models/backport_invoice_event.rb +139 -0
  32. data/lib/advanced_billing/models/bank_account_attributes.rb +10 -0
  33. data/lib/advanced_billing/models/billing_manifest.rb +5 -1
  34. data/lib/advanced_billing/models/billing_schedule.rb +10 -0
  35. data/lib/advanced_billing/models/change_chargeback_status_event.rb +141 -0
  36. data/lib/advanced_billing/models/change_chargeback_status_event_data.rb +73 -0
  37. data/lib/advanced_billing/models/change_invoice_collection_method_event.rb +141 -0
  38. data/lib/advanced_billing/models/change_invoice_status_event.rb +141 -0
  39. data/lib/advanced_billing/models/change_invoice_status_event_data.rb +131 -0
  40. data/lib/advanced_billing/models/chargeback_status.rb +29 -0
  41. data/lib/advanced_billing/models/component.rb +3 -13
  42. data/lib/advanced_billing/models/component_cost_data.rb +10 -0
  43. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +10 -0
  44. data/lib/advanced_billing/models/component_custom_price.rb +10 -0
  45. data/lib/advanced_billing/models/component_price_point.rb +2 -13
  46. data/lib/advanced_billing/models/component_price_point_item.rb +10 -0
  47. data/lib/advanced_billing/models/coupon.rb +4 -14
  48. data/lib/advanced_billing/models/create_component_price_point.rb +6 -2
  49. data/lib/advanced_billing/models/create_component_price_point_request.rb +1 -1
  50. data/lib/advanced_billing/models/create_component_price_points_request.rb +1 -1
  51. data/lib/advanced_billing/models/create_credit_note_event.rb +139 -0
  52. data/lib/advanced_billing/models/create_debit_note_event.rb +139 -0
  53. data/lib/advanced_billing/models/create_invoice_payment_application.rb +22 -0
  54. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +6 -2
  55. data/lib/advanced_billing/models/create_offer_component.rb +11 -0
  56. data/lib/advanced_billing/models/create_payment_profile.rb +4 -4
  57. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +10 -4
  58. data/lib/advanced_billing/models/create_product_family.rb +14 -4
  59. data/lib/advanced_billing/models/create_subscription.rb +2 -2
  60. data/lib/advanced_billing/models/credit_card_attributes.rb +10 -0
  61. data/lib/advanced_billing/models/credit_note_application.rb +10 -0
  62. data/lib/advanced_billing/models/credit_note_line_item.rb +10 -0
  63. data/lib/advanced_billing/models/customer.rb +13 -1
  64. data/lib/advanced_billing/models/customer_attributes.rb +10 -0
  65. data/lib/advanced_billing/models/customer_change.rb +7 -22
  66. data/lib/advanced_billing/models/customer_custom_fields_change.rb +0 -22
  67. data/lib/advanced_billing/models/customer_payer_change.rb +0 -22
  68. data/lib/advanced_billing/models/debit_note.rb +351 -0
  69. data/lib/advanced_billing/models/debit_note_role.rb +23 -0
  70. data/lib/advanced_billing/models/debit_note_status.rb +29 -0
  71. data/lib/advanced_billing/models/deduct_service_credit.rb +10 -16
  72. data/lib/advanced_billing/models/dunner_data.rb +38 -0
  73. data/lib/advanced_billing/models/dunning_step_data.rb +34 -0
  74. data/lib/advanced_billing/models/dunning_step_reached.rb +12 -6
  75. data/lib/advanced_billing/models/failed_payment_event.rb +139 -0
  76. data/lib/advanced_billing/models/failed_payment_event_data.rb +132 -0
  77. data/lib/advanced_billing/models/group_billing.rb +10 -0
  78. data/lib/advanced_billing/models/group_settings.rb +4 -2
  79. data/lib/advanced_billing/models/group_target.rb +14 -0
  80. data/lib/advanced_billing/models/historic_usage.rb +109 -0
  81. data/lib/advanced_billing/models/include_null_or_not_null.rb +23 -0
  82. data/lib/advanced_billing/models/invoice.rb +18 -8
  83. data/lib/advanced_billing/models/invoice_address.rb +10 -0
  84. data/lib/advanced_billing/models/invoice_balance_item.rb +10 -0
  85. data/lib/advanced_billing/models/invoice_credit.rb +10 -0
  86. data/lib/advanced_billing/models/invoice_custom_field.rb +10 -0
  87. data/lib/advanced_billing/models/invoice_customer.rb +10 -0
  88. data/lib/advanced_billing/models/invoice_discount.rb +10 -0
  89. data/lib/advanced_billing/models/invoice_discount_breakout.rb +10 -0
  90. data/lib/advanced_billing/models/invoice_display_settings.rb +10 -0
  91. data/lib/advanced_billing/models/invoice_event_type.rb +3 -0
  92. data/lib/advanced_billing/models/invoice_issued.rb +6 -2
  93. data/lib/advanced_billing/models/invoice_line_item.rb +3 -3
  94. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +10 -0
  95. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +10 -0
  96. data/lib/advanced_billing/models/invoice_payer.rb +10 -0
  97. data/lib/advanced_billing/models/invoice_payment.rb +10 -0
  98. data/lib/advanced_billing/models/invoice_payment_method.rb +10 -0
  99. data/lib/advanced_billing/models/invoice_pre_payment.rb +0 -10
  100. data/lib/advanced_billing/models/invoice_previous_balance.rb +10 -0
  101. data/lib/advanced_billing/models/invoice_refund.rb +10 -0
  102. data/lib/advanced_billing/models/invoice_seller.rb +10 -0
  103. data/lib/advanced_billing/models/invoice_status.rb +2 -2
  104. data/lib/advanced_billing/models/invoice_tax.rb +10 -0
  105. data/lib/advanced_billing/models/invoice_tax_breakout.rb +10 -0
  106. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +10 -0
  107. data/lib/advanced_billing/models/issue_invoice_event.rb +139 -0
  108. data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
  109. data/lib/advanced_billing/models/issue_service_credit.rb +10 -16
  110. data/lib/advanced_billing/models/item_price_point_changed.rb +8 -4
  111. data/lib/advanced_billing/models/item_price_point_data.rb +10 -0
  112. data/lib/advanced_billing/models/list_components_filter.rb +74 -0
  113. data/lib/advanced_billing/models/list_coupons_filter.rb +168 -0
  114. data/lib/advanced_billing/models/list_invoice_events_response.rb +14 -11
  115. data/lib/advanced_billing/models/{refund_prepayment_aggregated_error.rb → list_mrr_filter.rb} +14 -12
  116. data/lib/advanced_billing/models/{list_subscription_group_prepayment_date_field.rb → list_prepayment_date_field.rb} +4 -4
  117. data/lib/advanced_billing/models/list_prepayments_filter.rb +88 -0
  118. data/lib/advanced_billing/models/list_price_points_filter.rb +163 -0
  119. data/lib/advanced_billing/models/list_products_filter.rb +81 -0
  120. data/lib/advanced_billing/models/list_segments_filter.rb +103 -0
  121. data/lib/advanced_billing/models/list_subscription_components_filter.rb +74 -0
  122. data/lib/advanced_billing/models/list_subscription_components_for_site_filter.rb +84 -0
  123. data/lib/advanced_billing/models/list_subscription_components_include.rb +4 -1
  124. data/lib/advanced_billing/models/metafield_scope.rb +10 -0
  125. data/lib/advanced_billing/models/nested_subscription_group.rb +0 -10
  126. data/lib/advanced_billing/models/origin_invoice.rb +10 -0
  127. data/lib/advanced_billing/models/overage_pricing.rb +14 -0
  128. data/lib/advanced_billing/models/paid_invoice.rb +2 -2
  129. data/lib/advanced_billing/models/payer_attributes.rb +10 -0
  130. data/lib/advanced_billing/models/prepaid_component_price_point.rb +10 -0
  131. data/lib/advanced_billing/models/prepaid_product_price_point_filter.rb +56 -0
  132. data/lib/advanced_billing/models/prepaid_usage.rb +6 -2
  133. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +10 -0
  134. data/lib/advanced_billing/models/product.rb +5 -16
  135. data/lib/advanced_billing/models/product_price_point.rb +9 -0
  136. data/lib/advanced_billing/models/proforma_invoice.rb +2 -2
  137. data/lib/advanced_billing/models/proforma_invoice_issued.rb +6 -2
  138. data/lib/advanced_billing/models/reactivation_billing.rb +10 -0
  139. data/lib/advanced_billing/models/record_payment_response.rb +1 -13
  140. data/lib/advanced_billing/models/refund_invoice_event.rb +139 -0
  141. data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -2
  142. data/lib/advanced_billing/models/refund_invoice_request.rb +1 -1
  143. data/lib/advanced_billing/models/refund_prepayment.rb +3 -1
  144. data/lib/advanced_billing/models/remove_payment_event.rb +139 -0
  145. data/lib/advanced_billing/models/remove_payment_event_data.rb +1 -1
  146. data/lib/advanced_billing/models/segment_price.rb +10 -0
  147. data/lib/advanced_billing/models/subscription.rb +10 -16
  148. data/lib/advanced_billing/models/subscription_component.rb +26 -7
  149. data/lib/advanced_billing/models/subscription_component_subscription.rb +10 -0
  150. data/lib/advanced_billing/models/subscription_filter.rb +153 -0
  151. data/lib/advanced_billing/models/subscription_group.rb +2 -2
  152. data/lib/advanced_billing/models/subscription_group_bank_account.rb +10 -0
  153. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +10 -0
  154. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +3 -1
  155. data/lib/advanced_billing/models/subscription_group_signup.rb +2 -2
  156. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +4 -2
  157. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +10 -0
  158. data/lib/advanced_billing/models/subscription_group_signup_item.rb +10 -0
  159. data/lib/advanced_billing/models/subscription_group_signup_response.rb +2 -2
  160. data/lib/advanced_billing/models/subscription_group_signup_success.rb +8 -4
  161. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +50 -0
  162. data/lib/advanced_billing/models/update_customer.rb +12 -0
  163. data/lib/advanced_billing/models/update_subscription_component.rb +10 -0
  164. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +10 -0
  165. data/lib/advanced_billing/models/usage.rb +3 -1
  166. data/lib/advanced_billing/models/void_invoice_event.rb +139 -0
  167. data/lib/advanced_billing/models/void_invoice_event_data.rb +8 -7
  168. data/lib/advanced_billing/models/void_remainder_event.rb +139 -0
  169. data/lib/advanced_billing/models/void_remainder_event_data.rb +4 -2
  170. data/lib/advanced_billing/utilities/union_type_lookup.rb +69 -199
  171. data/lib/advanced_billing.rb +42 -18
  172. metadata +38 -17
  173. data/lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb +0 -33
  174. data/lib/advanced_billing/models/billing_address.rb +0 -117
  175. data/lib/advanced_billing/models/credit_note1.rb +0 -419
  176. data/lib/advanced_billing/models/customer1.rb +0 -125
  177. data/lib/advanced_billing/models/invoice_event.rb +0 -124
  178. data/lib/advanced_billing/models/invoice_event_data.rb +0 -447
  179. data/lib/advanced_billing/models/invoice_event_payment.rb +0 -168
  180. data/lib/advanced_billing/models/invoice_event_payment1.rb +0 -160
  181. data/lib/advanced_billing/models/prepayment_aggregated_error.rb +0 -81
  182. data/lib/advanced_billing/models/price_point.rb +0 -216
  183. data/lib/advanced_billing/models/refund.rb +0 -138
  184. data/lib/advanced_billing/models/seller.rb +0 -92
  185. data/lib/advanced_billing/models/shipping_address.rb +0 -117
@@ -0,0 +1,153 @@
1
+ # advanced_billing
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'date'
7
+ module AdvancedBilling
8
+ # Nested filter used for List Subscription Components For Site Filter
9
+ class SubscriptionFilter < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Allows fetching components allocations that belong to the subscription
14
+ # with matching states based on provided values. To use this filter you also
15
+ # have to include the following param in the request `include=subscription`.
16
+ # Use in query
17
+ # `filter[subscription][states]=active,canceled&include=subscription`.
18
+ # @return [Array[SubscriptionStateFilter]]
19
+ attr_accessor :states
20
+
21
+ # The type of filter you'd like to apply to your search. To use this filter
22
+ # you also have to include the following param in the request
23
+ # `include=subscription`.
24
+ # @return [SubscriptionListDateField]
25
+ attr_accessor :date_field
26
+
27
+ # The start date (format YYYY-MM-DD) with which to filter the date_field.
28
+ # Returns components that belong to the subscription with a timestamp at or
29
+ # after midnight (12:00:00 AM) in your site’s time zone on the date
30
+ # specified. To use this filter you also have to include the following param
31
+ # in the request `include=subscription`.
32
+ # @return [Date]
33
+ attr_accessor :start_date
34
+
35
+ # The end date (format YYYY-MM-DD) with which to filter the date_field.
36
+ # Returns components that belong to the subscription with a timestamp up to
37
+ # and including 11:59:59PM in your site’s time zone on the date specified.
38
+ # To use this filter you also have to include the following param in the
39
+ # request `include=subscription`.
40
+ # @return [Date]
41
+ attr_accessor :end_date
42
+
43
+ # The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter
44
+ # the date_field. Returns components that belong to the subscription with a
45
+ # timestamp at or after exact time provided in query. You can specify
46
+ # timezone in query - otherwise your site''s time zone will be used. If
47
+ # provided, this parameter will be used instead of start_date. To use this
48
+ # filter you also have to include the following param in the request
49
+ # `include=subscription`.
50
+ # @return [DateTime]
51
+ attr_accessor :start_datetime
52
+
53
+ # The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter
54
+ # the date_field. Returns components that belong to the subscription with a
55
+ # timestamp at or before exact time provided in query. You can specify
56
+ # timezone in query - otherwise your site''s time zone will be used. If
57
+ # provided, this parameter will be used instead of end_date. To use this
58
+ # filter you also have to include the following param in the request
59
+ # `include=subscription`.
60
+ # @return [DateTime]
61
+ attr_accessor :end_datetime
62
+
63
+ # A mapping from model property names to API property names.
64
+ def self.names
65
+ @_hash = {} if @_hash.nil?
66
+ @_hash['states'] = 'states'
67
+ @_hash['date_field'] = 'date_field'
68
+ @_hash['start_date'] = 'start_date'
69
+ @_hash['end_date'] = 'end_date'
70
+ @_hash['start_datetime'] = 'start_datetime'
71
+ @_hash['end_datetime'] = 'end_datetime'
72
+ @_hash
73
+ end
74
+
75
+ # An array for optional fields
76
+ def self.optionals
77
+ %w[
78
+ states
79
+ date_field
80
+ start_date
81
+ end_date
82
+ start_datetime
83
+ end_datetime
84
+ ]
85
+ end
86
+
87
+ # An array for nullable fields
88
+ def self.nullables
89
+ []
90
+ end
91
+
92
+ def initialize(states = SKIP,
93
+ date_field = SKIP,
94
+ start_date = SKIP,
95
+ end_date = SKIP,
96
+ start_datetime = SKIP,
97
+ end_datetime = SKIP,
98
+ additional_properties = {})
99
+ @states = states unless states == SKIP
100
+ @date_field = date_field unless date_field == SKIP
101
+ @start_date = start_date unless start_date == SKIP
102
+ @end_date = end_date unless end_date == SKIP
103
+ @start_datetime = start_datetime unless start_datetime == SKIP
104
+ @end_datetime = end_datetime unless end_datetime == SKIP
105
+
106
+ # Add additional model properties to the instance.
107
+ additional_properties.each do |_name, _value|
108
+ instance_variable_set("@#{_name}", _value)
109
+ end
110
+ end
111
+
112
+ # Creates an instance of the object from a hash.
113
+ def self.from_hash(hash)
114
+ return nil unless hash
115
+
116
+ # Extract variables from the hash.
117
+ states = hash.key?('states') ? hash['states'] : SKIP
118
+ date_field = hash.key?('date_field') ? hash['date_field'] : SKIP
119
+ start_date = hash.key?('start_date') ? hash['start_date'] : SKIP
120
+ end_date = hash.key?('end_date') ? hash['end_date'] : SKIP
121
+ start_datetime = if hash.key?('start_datetime')
122
+ (DateTimeHelper.from_rfc3339(hash['start_datetime']) if hash['start_datetime'])
123
+ else
124
+ SKIP
125
+ end
126
+ end_datetime = if hash.key?('end_datetime')
127
+ (DateTimeHelper.from_rfc3339(hash['end_datetime']) if hash['end_datetime'])
128
+ else
129
+ SKIP
130
+ end
131
+
132
+ # Clean out expected properties from Hash.
133
+ names.each_value { |k| hash.delete(k) }
134
+
135
+ # Create object from extracted values.
136
+ SubscriptionFilter.new(states,
137
+ date_field,
138
+ start_date,
139
+ end_date,
140
+ start_datetime,
141
+ end_datetime,
142
+ hash)
143
+ end
144
+
145
+ def to_custom_start_datetime
146
+ DateTimeHelper.to_rfc3339(start_datetime)
147
+ end
148
+
149
+ def to_custom_end_datetime
150
+ DateTimeHelper.to_rfc3339(end_datetime)
151
+ end
152
+ end
153
+ end
@@ -68,7 +68,7 @@ module AdvancedBilling
68
68
 
69
69
  def initialize(customer_id = SKIP,
70
70
  payment_profile = SKIP,
71
- payment_collection_method = CollectionMethod::AUTOMATIC,
71
+ payment_collection_method = SKIP,
72
72
  subscription_ids = SKIP,
73
73
  created_at = SKIP,
74
74
  additional_properties = {})
@@ -96,7 +96,7 @@ module AdvancedBilling
96
96
  payment_profile = SubscriptionGroupPaymentProfile.from_hash(hash['payment_profile']) if
97
97
  hash['payment_profile']
98
98
  payment_collection_method =
99
- hash['payment_collection_method'] ||= CollectionMethod::AUTOMATIC
99
+ hash.key?('payment_collection_method') ? hash['payment_collection_method'] : SKIP
100
100
  subscription_ids =
101
101
  hash.key?('subscription_ids') ? hash['subscription_ids'] : SKIP
102
102
  created_at = if hash.key?('created_at')
@@ -222,5 +222,15 @@ module AdvancedBilling
222
222
  gateway_handle,
223
223
  hash)
224
224
  end
225
+
226
+ # Validates an instance of the object from a given value.
227
+ # @param [SubscriptionGroupBankAccount | Hash] The value against the validation is performed.
228
+ def self.validate(value)
229
+ return true if value.instance_of? self
230
+
231
+ return false unless value.instance_of? Hash
232
+
233
+ true
234
+ end
225
235
  end
226
236
  end
@@ -102,5 +102,15 @@ module AdvancedBilling
102
102
  overage_pricing,
103
103
  hash)
104
104
  end
105
+
106
+ # Validates an instance of the object from a given value.
107
+ # @param [SubscriptionGroupComponentCustomPrice | Hash] The value against the validation is performed.
108
+ def self.validate(value)
109
+ return true if value.instance_of? self
110
+
111
+ return false unless value.instance_of? Hash
112
+
113
+ true
114
+ end
105
115
  end
106
116
  end
@@ -53,7 +53,9 @@ module AdvancedBilling
53
53
 
54
54
  # An array for nullable fields
55
55
  def self.nullables
56
- []
56
+ %w[
57
+ memo
58
+ ]
57
59
  end
58
60
 
59
61
  def initialize(id = SKIP,
@@ -92,7 +92,7 @@ module AdvancedBilling
92
92
  payment_profile_id = SKIP,
93
93
  payer_id = SKIP,
94
94
  payer_reference = SKIP,
95
- payment_collection_method = CollectionMethod::AUTOMATIC,
95
+ payment_collection_method = SKIP,
96
96
  payer_attributes = SKIP,
97
97
  credit_card_attributes = SKIP,
98
98
  bank_account_attributes = SKIP,
@@ -136,7 +136,7 @@ module AdvancedBilling
136
136
  payer_reference =
137
137
  hash.key?('payer_reference') ? hash['payer_reference'] : SKIP
138
138
  payment_collection_method =
139
- hash['payment_collection_method'] ||= CollectionMethod::AUTOMATIC
139
+ hash.key?('payment_collection_method') ? hash['payment_collection_method'] : SKIP
140
140
  payer_attributes = PayerAttributes.from_hash(hash['payer_attributes']) if
141
141
  hash['payer_attributes']
142
142
  if hash['credit_card_attributes']
@@ -74,7 +74,8 @@ module AdvancedBilling
74
74
  if value.instance_of? self
75
75
  return (
76
76
  APIHelper.valid_type?(value.subscription_group,
77
- ->(val) { SubscriptionGroupSignupFailureData.validate(val) }) and
77
+ ->(val) { SubscriptionGroupSignupFailureData.validate(val) },
78
+ is_model_hash: true) and
78
79
  APIHelper.valid_type?(value.customer,
79
80
  ->(val) { val.instance_of? String })
80
81
  )
@@ -84,7 +85,8 @@ module AdvancedBilling
84
85
 
85
86
  (
86
87
  APIHelper.valid_type?(value['subscription_group'],
87
- ->(val) { SubscriptionGroupSignupFailureData.validate(val) }) and
88
+ ->(val) { SubscriptionGroupSignupFailureData.validate(val) },
89
+ is_model_hash: true) and
88
90
  APIHelper.valid_type?(value['customer'],
89
91
  ->(val) { val.instance_of? String })
90
92
  )
@@ -146,5 +146,15 @@ module AdvancedBilling
146
146
  subscriptions,
147
147
  hash)
148
148
  end
149
+
150
+ # Validates an instance of the object from a given value.
151
+ # @param [SubscriptionGroupSignupFailureData | Hash] The value against the validation is performed.
152
+ def self.validate(value)
153
+ return true if value.instance_of? self
154
+
155
+ return false unless value.instance_of? Hash
156
+
157
+ true
158
+ end
149
159
  end
150
160
  end
@@ -203,5 +203,15 @@ module AdvancedBilling
203
203
  metafields,
204
204
  hash)
205
205
  end
206
+
207
+ # Validates an instance of the object from a given value.
208
+ # @param [SubscriptionGroupSignupItem | Hash] The value against the validation is performed.
209
+ def self.validate(value)
210
+ return true if value.instance_of? self
211
+
212
+ return false unless value.instance_of? Hash
213
+
214
+ true
215
+ end
206
216
  end
207
217
  end
@@ -310,7 +310,7 @@ module AdvancedBilling
310
310
  state = SKIP,
311
311
  cancel_at_end_of_period = SKIP,
312
312
  subscriptions = SKIP,
313
- payment_collection_method = CollectionMethod::AUTOMATIC,
313
+ payment_collection_method = SKIP,
314
314
  additional_properties = {})
315
315
  @uid = uid unless uid == SKIP
316
316
  @scheme = scheme unless scheme == SKIP
@@ -366,7 +366,7 @@ module AdvancedBilling
366
366
 
367
367
  subscriptions = SKIP unless hash.key?('subscriptions')
368
368
  payment_collection_method =
369
- hash['payment_collection_method'] ||= CollectionMethod::AUTOMATIC
369
+ hash.key?('payment_collection_method') ? hash['payment_collection_method'] : SKIP
370
370
 
371
371
  # Clean out expected properties from Hash.
372
372
  names.each_value { |k| hash.delete(k) }
@@ -72,9 +72,11 @@ module AdvancedBilling
72
72
  if value.instance_of? self
73
73
  return (
74
74
  APIHelper.valid_type?(value.subscription_group,
75
- ->(val) { SubscriptionGroupSignupSuccessData.validate(val) }) and
75
+ ->(val) { SubscriptionGroupSignupSuccessData.validate(val) },
76
+ is_model_hash: true) and
76
77
  APIHelper.valid_type?(value.customer,
77
- ->(val) { Customer.validate(val) })
78
+ ->(val) { Customer.validate(val) },
79
+ is_model_hash: true)
78
80
  )
79
81
  end
80
82
 
@@ -82,9 +84,11 @@ module AdvancedBilling
82
84
 
83
85
  (
84
86
  APIHelper.valid_type?(value['subscription_group'],
85
- ->(val) { SubscriptionGroupSignupSuccessData.validate(val) }) and
87
+ ->(val) { SubscriptionGroupSignupSuccessData.validate(val) },
88
+ is_model_hash: true) and
86
89
  APIHelper.valid_type?(value['customer'],
87
- ->(val) { Customer.validate(val) })
90
+ ->(val) { Customer.validate(val) },
91
+ is_model_hash: true)
88
92
  )
89
93
  end
90
94
  end
@@ -137,5 +137,55 @@ module AdvancedBilling
137
137
  def to_custom_next_assessment_at
138
138
  DateTimeHelper.to_rfc3339(next_assessment_at)
139
139
  end
140
+
141
+ # Validates an instance of the object from a given value.
142
+ # @param [SubscriptionGroupSignupSuccessData | Hash] The value against the validation is performed.
143
+ def self.validate(value)
144
+ if value.instance_of? self
145
+ return (
146
+ APIHelper.valid_type?(value.uid,
147
+ ->(val) { val.instance_of? String }) and
148
+ APIHelper.valid_type?(value.scheme,
149
+ ->(val) { val.instance_of? Integer }) and
150
+ APIHelper.valid_type?(value.customer_id,
151
+ ->(val) { val.instance_of? Integer }) and
152
+ APIHelper.valid_type?(value.payment_profile_id,
153
+ ->(val) { val.instance_of? Integer }) and
154
+ APIHelper.valid_type?(value.subscription_ids,
155
+ ->(val) { val.instance_of? Integer }) and
156
+ APIHelper.valid_type?(value.primary_subscription_id,
157
+ ->(val) { val.instance_of? Integer }) and
158
+ APIHelper.valid_type?(value.next_assessment_at,
159
+ ->(val) { val.instance_of? DateTime }) and
160
+ APIHelper.valid_type?(value.state,
161
+ ->(val) { val.instance_of? String }) and
162
+ APIHelper.valid_type?(value.cancel_at_end_of_period,
163
+ ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass })
164
+ )
165
+ end
166
+
167
+ return false unless value.instance_of? Hash
168
+
169
+ (
170
+ APIHelper.valid_type?(value['uid'],
171
+ ->(val) { val.instance_of? String }) and
172
+ APIHelper.valid_type?(value['scheme'],
173
+ ->(val) { val.instance_of? Integer }) and
174
+ APIHelper.valid_type?(value['customer_id'],
175
+ ->(val) { val.instance_of? Integer }) and
176
+ APIHelper.valid_type?(value['payment_profile_id'],
177
+ ->(val) { val.instance_of? Integer }) and
178
+ APIHelper.valid_type?(value['subscription_ids'],
179
+ ->(val) { val.instance_of? Integer }) and
180
+ APIHelper.valid_type?(value['primary_subscription_id'],
181
+ ->(val) { val.instance_of? Integer }) and
182
+ APIHelper.valid_type?(value['next_assessment_at'],
183
+ ->(val) { val.instance_of? String }) and
184
+ APIHelper.valid_type?(value['state'],
185
+ ->(val) { val.instance_of? String }) and
186
+ APIHelper.valid_type?(value['cancel_at_end_of_period'],
187
+ ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass })
188
+ )
189
+ end
140
190
  end
141
191
  end
@@ -81,6 +81,11 @@ module AdvancedBilling
81
81
  # @return [Integer]
82
82
  attr_accessor :parent_id
83
83
 
84
+ # Is the customer verified to use ACH as a payment method. Available only on
85
+ # Authorize.Net gateway
86
+ # @return [TrueClass | FalseClass]
87
+ attr_accessor :verified
88
+
84
89
  # A mapping from model property names to API property names.
85
90
  def self.names
86
91
  @_hash = {} if @_hash.nil?
@@ -102,6 +107,7 @@ module AdvancedBilling
102
107
  @_hash['tax_exempt'] = 'tax_exempt'
103
108
  @_hash['tax_exempt_reason'] = 'tax_exempt_reason'
104
109
  @_hash['parent_id'] = 'parent_id'
110
+ @_hash['verified'] = 'verified'
105
111
  @_hash
106
112
  end
107
113
 
@@ -126,6 +132,7 @@ module AdvancedBilling
126
132
  tax_exempt
127
133
  tax_exempt_reason
128
134
  parent_id
135
+ verified
129
136
  ]
130
137
  end
131
138
 
@@ -133,6 +140,7 @@ module AdvancedBilling
133
140
  def self.nullables
134
141
  %w[
135
142
  parent_id
143
+ verified
136
144
  ]
137
145
  end
138
146
 
@@ -154,6 +162,7 @@ module AdvancedBilling
154
162
  tax_exempt = SKIP,
155
163
  tax_exempt_reason = SKIP,
156
164
  parent_id = SKIP,
165
+ verified = SKIP,
157
166
  additional_properties = {})
158
167
  @first_name = first_name unless first_name == SKIP
159
168
  @last_name = last_name unless last_name == SKIP
@@ -173,6 +182,7 @@ module AdvancedBilling
173
182
  @tax_exempt = tax_exempt unless tax_exempt == SKIP
174
183
  @tax_exempt_reason = tax_exempt_reason unless tax_exempt_reason == SKIP
175
184
  @parent_id = parent_id unless parent_id == SKIP
185
+ @verified = verified unless verified == SKIP
176
186
 
177
187
  # Add additional model properties to the instance.
178
188
  additional_properties.each do |_name, _value|
@@ -204,6 +214,7 @@ module AdvancedBilling
204
214
  tax_exempt_reason =
205
215
  hash.key?('tax_exempt_reason') ? hash['tax_exempt_reason'] : SKIP
206
216
  parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP
217
+ verified = hash.key?('verified') ? hash['verified'] : SKIP
207
218
 
208
219
  # Clean out expected properties from Hash.
209
220
  names.each_value { |k| hash.delete(k) }
@@ -227,6 +238,7 @@ module AdvancedBilling
227
238
  tax_exempt,
228
239
  tax_exempt_reason,
229
240
  parent_id,
241
+ verified,
230
242
  hash)
231
243
  end
232
244
  end
@@ -67,5 +67,15 @@ module AdvancedBilling
67
67
  custom_price,
68
68
  hash)
69
69
  end
70
+
71
+ # Validates an instance of the object from a given value.
72
+ # @param [UpdateSubscriptionComponent | Hash] The value against the validation is performed.
73
+ def self.validate(value)
74
+ return true if value.instance_of? self
75
+
76
+ return false unless value.instance_of? Hash
77
+
78
+ true
79
+ end
70
80
  end
71
81
  end
@@ -101,5 +101,15 @@ module AdvancedBilling
101
101
  replenish_threshold_amount_in_cents,
102
102
  hash)
103
103
  end
104
+
105
+ # Validates an instance of the object from a given value.
106
+ # @param [UpsertPrepaidConfiguration | Hash] The value against the validation is performed.
107
+ def self.validate(value)
108
+ return true if value.instance_of? self
109
+
110
+ return false unless value.instance_of? Hash
111
+
112
+ true
113
+ end
104
114
  end
105
115
  end
@@ -78,7 +78,9 @@ module AdvancedBilling
78
78
 
79
79
  # An array for nullable fields
80
80
  def self.nullables
81
- []
81
+ %w[
82
+ memo
83
+ ]
82
84
  end
83
85
 
84
86
  def initialize(id = SKIP,
@@ -0,0 +1,139 @@
1
+ # advanced_billing
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ require 'date'
7
+ module AdvancedBilling
8
+ # VoidInvoiceEvent Model.
9
+ class VoidInvoiceEvent < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [Integer]
15
+ attr_accessor :id
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [DateTime]
19
+ attr_accessor :timestamp
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [Invoice]
23
+ attr_accessor :invoice
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [InvoiceEventType]
27
+ attr_accessor :event_type
28
+
29
+ # Example schema for an `void_invoice` event
30
+ # @return [VoidInvoiceEventData]
31
+ attr_accessor :event_data
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['id'] = 'id'
37
+ @_hash['timestamp'] = 'timestamp'
38
+ @_hash['invoice'] = 'invoice'
39
+ @_hash['event_type'] = 'event_type'
40
+ @_hash['event_data'] = 'event_data'
41
+ @_hash
42
+ end
43
+
44
+ # An array for optional fields
45
+ def self.optionals
46
+ []
47
+ end
48
+
49
+ # An array for nullable fields
50
+ def self.nullables
51
+ []
52
+ end
53
+
54
+ def initialize(id = nil,
55
+ timestamp = nil,
56
+ invoice = nil,
57
+ event_type = InvoiceEventType::VOID_INVOICE,
58
+ event_data = nil,
59
+ additional_properties = {})
60
+ @id = id
61
+ @timestamp = timestamp
62
+ @invoice = invoice
63
+ @event_type = event_type
64
+ @event_data = event_data
65
+
66
+ # Add additional model properties to the instance.
67
+ additional_properties.each do |_name, _value|
68
+ instance_variable_set("@#{_name}", _value)
69
+ end
70
+ end
71
+
72
+ # Creates an instance of the object from a hash.
73
+ def self.from_hash(hash)
74
+ return nil unless hash
75
+
76
+ # Extract variables from the hash.
77
+ id = hash.key?('id') ? hash['id'] : nil
78
+ timestamp = if hash.key?('timestamp')
79
+ (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
80
+ end
81
+ invoice = Invoice.from_hash(hash['invoice']) if hash['invoice']
82
+ event_type = hash['event_type'] ||= InvoiceEventType::VOID_INVOICE
83
+ event_data = VoidInvoiceEventData.from_hash(hash['event_data']) if hash['event_data']
84
+
85
+ # Clean out expected properties from Hash.
86
+ names.each_value { |k| hash.delete(k) }
87
+
88
+ # Create object from extracted values.
89
+ VoidInvoiceEvent.new(id,
90
+ timestamp,
91
+ invoice,
92
+ event_type,
93
+ event_data,
94
+ hash)
95
+ end
96
+
97
+ def to_custom_timestamp
98
+ DateTimeHelper.to_rfc3339(timestamp)
99
+ end
100
+
101
+ # Validates an instance of the object from a given value.
102
+ # @param [VoidInvoiceEvent | Hash] The value against the validation is performed.
103
+ def self.validate(value)
104
+ if value.instance_of? self
105
+ return (
106
+ APIHelper.valid_type?(value.id,
107
+ ->(val) { val.instance_of? Integer }) and
108
+ APIHelper.valid_type?(value.timestamp,
109
+ ->(val) { val.instance_of? DateTime }) and
110
+ APIHelper.valid_type?(value.invoice,
111
+ ->(val) { Invoice.validate(val) },
112
+ is_model_hash: true) and
113
+ APIHelper.valid_type?(value.event_type,
114
+ ->(val) { InvoiceEventType.validate(val) }) and
115
+ APIHelper.valid_type?(value.event_data,
116
+ ->(val) { VoidInvoiceEventData.validate(val) },
117
+ is_model_hash: true)
118
+ )
119
+ end
120
+
121
+ return false unless value.instance_of? Hash
122
+
123
+ (
124
+ APIHelper.valid_type?(value['id'],
125
+ ->(val) { val.instance_of? Integer }) and
126
+ APIHelper.valid_type?(value['timestamp'],
127
+ ->(val) { val.instance_of? String }) and
128
+ APIHelper.valid_type?(value['invoice'],
129
+ ->(val) { Invoice.validate(val) },
130
+ is_model_hash: true) and
131
+ APIHelper.valid_type?(value['event_type'],
132
+ ->(val) { InvoiceEventType.validate(val) }) and
133
+ APIHelper.valid_type?(value['event_data'],
134
+ ->(val) { VoidInvoiceEventData.validate(val) },
135
+ is_model_hash: true)
136
+ )
137
+ end
138
+ end
139
+ end