maxio-advanced-billing-sdk 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,447 +0,0 @@
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
- # The event data is the data that, when combined with the command, results in
9
- # the output invoice found in the invoice field.
10
- class InvoiceEventData < BaseModel
11
- SKIP = Object.new
12
- private_constant :SKIP
13
-
14
- # Unique identifier for the credit note application. It is generated
15
- # automatically by Chargify and has the prefix "cdt_" followed by
16
- # alphanumeric characters.
17
- # @return [String]
18
- attr_accessor :uid
19
-
20
- # A unique, identifying string that appears on the credit note and in places
21
- # it is referenced.
22
- # @return [String]
23
- attr_accessor :credit_note_number
24
-
25
- # Unique identifier for the credit note. It is generated automatically by
26
- # Chargify and has the prefix "cn_" followed by alphanumeric characters.
27
- # @return [String]
28
- attr_accessor :credit_note_uid
29
-
30
- # The full, original amount of the credit note.
31
- # @return [String]
32
- attr_accessor :original_amount
33
-
34
- # The amount of the credit note applied to invoice.
35
- # @return [String]
36
- attr_accessor :applied_amount
37
-
38
- # The time the credit note was applied, in ISO 8601 format, i.e.
39
- # "2019-06-07T17:20:06Z"
40
- # @return [DateTime]
41
- attr_accessor :transaction_time
42
-
43
- # The credit note memo.
44
- # @return [String]
45
- attr_accessor :memo
46
-
47
- # The role of the credit note (e.g. 'general')
48
- # @return [String]
49
- attr_accessor :role
50
-
51
- # Shows whether it was applied to consolidated invoice or not
52
- # @return [TrueClass | FalseClass]
53
- attr_accessor :consolidated_invoice
54
-
55
- # List of credit notes applied to children invoices (if consolidated
56
- # invoice)
57
- # @return [Array[AppliedCreditNoteData]]
58
- attr_accessor :applied_credit_notes
59
-
60
- # A unique, identifying string that appears on the debit note and in places
61
- # it is referenced.
62
- # @return [String]
63
- attr_accessor :debit_note_number
64
-
65
- # Unique identifier for the debit note. It is generated automatically by
66
- # Chargify and has the prefix "db_" followed by alphanumeric characters.
67
- # @return [String]
68
- attr_accessor :debit_note_uid
69
-
70
- # A nested data structure detailing the method of payment
71
- # @return [InvoiceEventPayment1]
72
- attr_accessor :payment_method
73
-
74
- # The Chargify id of the original payment
75
- # @return [Integer]
76
- attr_accessor :transaction_id
77
-
78
- # The Chargify id of the original payment
79
- # @return [Integer]
80
- attr_accessor :parent_invoice_number
81
-
82
- # The Chargify id of the original payment
83
- # @return [String]
84
- attr_accessor :remaining_prepayment_amount
85
-
86
- # The flag that shows whether the original payment was a prepayment or not
87
- # @return [TrueClass | FalseClass]
88
- attr_accessor :prepayment
89
-
90
- # The flag that shows whether the original payment was a prepayment or not
91
- # @return [TrueClass | FalseClass]
92
- attr_accessor :external
93
-
94
- # The previous collection method of the invoice.
95
- # @return [String]
96
- attr_accessor :from_collection_method
97
-
98
- # The new collection method of the invoice.
99
- # @return [String]
100
- attr_accessor :to_collection_method
101
-
102
- # Consolidation level of the invoice, which is applicable to invoice
103
- # consolidation. It will hold one of the following values:
104
- # * "none": A normal invoice with no consolidation.
105
- # * "child": An invoice segment which has been combined into a consolidated
106
- # invoice.
107
- # * "parent": A consolidated invoice, whose contents are composed of invoice
108
- # segments.
109
- # "Parent" invoices do not have lines of their own, but they have subtotals
110
- # and totals which aggregate the member invoice segments.
111
- # See also the [invoice consolidation
112
- # documentation](https://chargify.zendesk.com/hc/en-us/articles/440774639183
113
- # 5).
114
- # @return [InvoiceConsolidationLevel]
115
- attr_accessor :consolidation_level
116
-
117
- # The status of the invoice before event occurence. See [Invoice
118
- # Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#lin
119
- # e-item-breakdowns) for more.
120
- # @return [InvoiceStatus]
121
- attr_accessor :from_status
122
-
123
- # The status of the invoice after event occurence. See [Invoice
124
- # Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#lin
125
- # e-item-breakdowns) for more.
126
- # @return [InvoiceStatus]
127
- attr_accessor :to_status
128
-
129
- # Amount due on the invoice, which is `total_amount - credit_amount -
130
- # paid_amount`.
131
- # @return [String]
132
- attr_accessor :due_amount
133
-
134
- # The invoice total, which is `subtotal_amount - discount_amount +
135
- # tax_amount`.'
136
- # @return [String]
137
- attr_accessor :total_amount
138
-
139
- # If true, credit was created and applied it to the invoice.
140
- # @return [TrueClass | FalseClass]
141
- attr_accessor :apply_credit
142
-
143
- # If true, credit was created and applied it to the invoice.
144
- # @return [CreditNote1]
145
- attr_accessor :credit_note_attributes
146
-
147
- # The ID of the payment transaction to be refunded.
148
- # @return [Integer]
149
- attr_accessor :payment_id
150
-
151
- # The amount of the refund.
152
- # @return [String]
153
- attr_accessor :refund_amount
154
-
155
- # The ID of the refund transaction.
156
- # @return [Integer]
157
- attr_accessor :refund_id
158
-
159
- # If true, the invoice is an advance invoice.
160
- # @return [TrueClass | FalseClass]
161
- attr_accessor :is_advance_invoice
162
-
163
- # The reason for the void.
164
- # @return [String]
165
- attr_accessor :reason
166
-
167
- # A mapping from model property names to API property names.
168
- def self.names
169
- @_hash = {} if @_hash.nil?
170
- @_hash['uid'] = 'uid'
171
- @_hash['credit_note_number'] = 'credit_note_number'
172
- @_hash['credit_note_uid'] = 'credit_note_uid'
173
- @_hash['original_amount'] = 'original_amount'
174
- @_hash['applied_amount'] = 'applied_amount'
175
- @_hash['transaction_time'] = 'transaction_time'
176
- @_hash['memo'] = 'memo'
177
- @_hash['role'] = 'role'
178
- @_hash['consolidated_invoice'] = 'consolidated_invoice'
179
- @_hash['applied_credit_notes'] = 'applied_credit_notes'
180
- @_hash['debit_note_number'] = 'debit_note_number'
181
- @_hash['debit_note_uid'] = 'debit_note_uid'
182
- @_hash['payment_method'] = 'payment_method'
183
- @_hash['transaction_id'] = 'transaction_id'
184
- @_hash['parent_invoice_number'] = 'parent_invoice_number'
185
- @_hash['remaining_prepayment_amount'] = 'remaining_prepayment_amount'
186
- @_hash['prepayment'] = 'prepayment'
187
- @_hash['external'] = 'external'
188
- @_hash['from_collection_method'] = 'from_collection_method'
189
- @_hash['to_collection_method'] = 'to_collection_method'
190
- @_hash['consolidation_level'] = 'consolidation_level'
191
- @_hash['from_status'] = 'from_status'
192
- @_hash['to_status'] = 'to_status'
193
- @_hash['due_amount'] = 'due_amount'
194
- @_hash['total_amount'] = 'total_amount'
195
- @_hash['apply_credit'] = 'apply_credit'
196
- @_hash['credit_note_attributes'] = 'credit_note_attributes'
197
- @_hash['payment_id'] = 'payment_id'
198
- @_hash['refund_amount'] = 'refund_amount'
199
- @_hash['refund_id'] = 'refund_id'
200
- @_hash['is_advance_invoice'] = 'is_advance_invoice'
201
- @_hash['reason'] = 'reason'
202
- @_hash
203
- end
204
-
205
- # An array for optional fields
206
- def self.optionals
207
- %w[
208
- uid
209
- credit_note_number
210
- credit_note_uid
211
- original_amount
212
- applied_amount
213
- transaction_time
214
- memo
215
- role
216
- consolidated_invoice
217
- applied_credit_notes
218
- debit_note_number
219
- debit_note_uid
220
- payment_method
221
- transaction_id
222
- parent_invoice_number
223
- remaining_prepayment_amount
224
- prepayment
225
- external
226
- from_collection_method
227
- to_collection_method
228
- consolidation_level
229
- from_status
230
- to_status
231
- due_amount
232
- total_amount
233
- apply_credit
234
- credit_note_attributes
235
- payment_id
236
- refund_amount
237
- refund_id
238
- is_advance_invoice
239
- reason
240
- ]
241
- end
242
-
243
- # An array for nullable fields
244
- def self.nullables
245
- %w[
246
- parent_invoice_number
247
- remaining_prepayment_amount
248
- ]
249
- end
250
-
251
- def initialize(uid = SKIP,
252
- credit_note_number = SKIP,
253
- credit_note_uid = SKIP,
254
- original_amount = SKIP,
255
- applied_amount = SKIP,
256
- transaction_time = SKIP,
257
- memo = SKIP,
258
- role = SKIP,
259
- consolidated_invoice = SKIP,
260
- applied_credit_notes = SKIP,
261
- debit_note_number = SKIP,
262
- debit_note_uid = SKIP,
263
- payment_method = SKIP,
264
- transaction_id = SKIP,
265
- parent_invoice_number = SKIP,
266
- remaining_prepayment_amount = SKIP,
267
- prepayment = SKIP,
268
- external = SKIP,
269
- from_collection_method = SKIP,
270
- to_collection_method = SKIP,
271
- consolidation_level = SKIP,
272
- from_status = SKIP,
273
- to_status = SKIP,
274
- due_amount = SKIP,
275
- total_amount = SKIP,
276
- apply_credit = SKIP,
277
- credit_note_attributes = SKIP,
278
- payment_id = SKIP,
279
- refund_amount = SKIP,
280
- refund_id = SKIP,
281
- is_advance_invoice = SKIP,
282
- reason = SKIP,
283
- additional_properties = {})
284
- @uid = uid unless uid == SKIP
285
- @credit_note_number = credit_note_number unless credit_note_number == SKIP
286
- @credit_note_uid = credit_note_uid unless credit_note_uid == SKIP
287
- @original_amount = original_amount unless original_amount == SKIP
288
- @applied_amount = applied_amount unless applied_amount == SKIP
289
- @transaction_time = transaction_time unless transaction_time == SKIP
290
- @memo = memo unless memo == SKIP
291
- @role = role unless role == SKIP
292
- @consolidated_invoice = consolidated_invoice unless consolidated_invoice == SKIP
293
- @applied_credit_notes = applied_credit_notes unless applied_credit_notes == SKIP
294
- @debit_note_number = debit_note_number unless debit_note_number == SKIP
295
- @debit_note_uid = debit_note_uid unless debit_note_uid == SKIP
296
- @payment_method = payment_method unless payment_method == SKIP
297
- @transaction_id = transaction_id unless transaction_id == SKIP
298
- @parent_invoice_number = parent_invoice_number unless parent_invoice_number == SKIP
299
- unless remaining_prepayment_amount == SKIP
300
- @remaining_prepayment_amount =
301
- remaining_prepayment_amount
302
- end
303
- @prepayment = prepayment unless prepayment == SKIP
304
- @external = external unless external == SKIP
305
- @from_collection_method = from_collection_method unless from_collection_method == SKIP
306
- @to_collection_method = to_collection_method unless to_collection_method == SKIP
307
- @consolidation_level = consolidation_level unless consolidation_level == SKIP
308
- @from_status = from_status unless from_status == SKIP
309
- @to_status = to_status unless to_status == SKIP
310
- @due_amount = due_amount unless due_amount == SKIP
311
- @total_amount = total_amount unless total_amount == SKIP
312
- @apply_credit = apply_credit unless apply_credit == SKIP
313
- @credit_note_attributes = credit_note_attributes unless credit_note_attributes == SKIP
314
- @payment_id = payment_id unless payment_id == SKIP
315
- @refund_amount = refund_amount unless refund_amount == SKIP
316
- @refund_id = refund_id unless refund_id == SKIP
317
- @is_advance_invoice = is_advance_invoice unless is_advance_invoice == SKIP
318
- @reason = reason unless reason == SKIP
319
-
320
- # Add additional model properties to the instance.
321
- additional_properties.each do |_name, _value|
322
- instance_variable_set("@#{_name}", _value)
323
- end
324
- end
325
-
326
- # Creates an instance of the object from a hash.
327
- def self.from_hash(hash)
328
- return nil unless hash
329
-
330
- # Extract variables from the hash.
331
- uid = hash.key?('uid') ? hash['uid'] : SKIP
332
- credit_note_number =
333
- hash.key?('credit_note_number') ? hash['credit_note_number'] : SKIP
334
- credit_note_uid =
335
- hash.key?('credit_note_uid') ? hash['credit_note_uid'] : SKIP
336
- original_amount =
337
- hash.key?('original_amount') ? hash['original_amount'] : SKIP
338
- applied_amount =
339
- hash.key?('applied_amount') ? hash['applied_amount'] : SKIP
340
- transaction_time = if hash.key?('transaction_time')
341
- (DateTimeHelper.from_rfc3339(hash['transaction_time']) if hash['transaction_time'])
342
- else
343
- SKIP
344
- end
345
- memo = hash.key?('memo') ? hash['memo'] : SKIP
346
- role = hash.key?('role') ? hash['role'] : SKIP
347
- consolidated_invoice =
348
- hash.key?('consolidated_invoice') ? hash['consolidated_invoice'] : SKIP
349
- # Parameter is an array, so we need to iterate through it
350
- applied_credit_notes = nil
351
- unless hash['applied_credit_notes'].nil?
352
- applied_credit_notes = []
353
- hash['applied_credit_notes'].each do |structure|
354
- applied_credit_notes << (AppliedCreditNoteData.from_hash(structure) if structure)
355
- end
356
- end
357
-
358
- applied_credit_notes = SKIP unless hash.key?('applied_credit_notes')
359
- debit_note_number =
360
- hash.key?('debit_note_number') ? hash['debit_note_number'] : SKIP
361
- debit_note_uid =
362
- hash.key?('debit_note_uid') ? hash['debit_note_uid'] : SKIP
363
- payment_method = hash.key?('payment_method') ? APIHelper.deserialize_union_type(
364
- UnionTypeLookUp.get(:InvoiceEventDataPaymentMethod), hash['payment_method']
365
- ) : SKIP
366
- transaction_id =
367
- hash.key?('transaction_id') ? hash['transaction_id'] : SKIP
368
- parent_invoice_number =
369
- hash.key?('parent_invoice_number') ? hash['parent_invoice_number'] : SKIP
370
- remaining_prepayment_amount =
371
- hash.key?('remaining_prepayment_amount') ? hash['remaining_prepayment_amount'] : SKIP
372
- prepayment = hash.key?('prepayment') ? hash['prepayment'] : SKIP
373
- external = hash.key?('external') ? hash['external'] : SKIP
374
- from_collection_method =
375
- hash.key?('from_collection_method') ? hash['from_collection_method'] : SKIP
376
- to_collection_method =
377
- hash.key?('to_collection_method') ? hash['to_collection_method'] : SKIP
378
- consolidation_level =
379
- hash.key?('consolidation_level') ? hash['consolidation_level'] : SKIP
380
- from_status = hash.key?('from_status') ? hash['from_status'] : SKIP
381
- to_status = hash.key?('to_status') ? hash['to_status'] : SKIP
382
- due_amount = hash.key?('due_amount') ? hash['due_amount'] : SKIP
383
- total_amount = hash.key?('total_amount') ? hash['total_amount'] : SKIP
384
- apply_credit = hash.key?('apply_credit') ? hash['apply_credit'] : SKIP
385
- credit_note_attributes = CreditNote1.from_hash(hash['credit_note_attributes']) if
386
- hash['credit_note_attributes']
387
- payment_id = hash.key?('payment_id') ? hash['payment_id'] : SKIP
388
- refund_amount = hash.key?('refund_amount') ? hash['refund_amount'] : SKIP
389
- refund_id = hash.key?('refund_id') ? hash['refund_id'] : SKIP
390
- is_advance_invoice =
391
- hash.key?('is_advance_invoice') ? hash['is_advance_invoice'] : SKIP
392
- reason = hash.key?('reason') ? hash['reason'] : SKIP
393
-
394
- # Clean out expected properties from Hash.
395
- names.each_value { |k| hash.delete(k) }
396
-
397
- # Create object from extracted values.
398
- InvoiceEventData.new(uid,
399
- credit_note_number,
400
- credit_note_uid,
401
- original_amount,
402
- applied_amount,
403
- transaction_time,
404
- memo,
405
- role,
406
- consolidated_invoice,
407
- applied_credit_notes,
408
- debit_note_number,
409
- debit_note_uid,
410
- payment_method,
411
- transaction_id,
412
- parent_invoice_number,
413
- remaining_prepayment_amount,
414
- prepayment,
415
- external,
416
- from_collection_method,
417
- to_collection_method,
418
- consolidation_level,
419
- from_status,
420
- to_status,
421
- due_amount,
422
- total_amount,
423
- apply_credit,
424
- credit_note_attributes,
425
- payment_id,
426
- refund_amount,
427
- refund_id,
428
- is_advance_invoice,
429
- reason,
430
- hash)
431
- end
432
-
433
- def to_custom_transaction_time
434
- DateTimeHelper.to_rfc3339(transaction_time)
435
- end
436
-
437
- # Validates an instance of the object from a given value.
438
- # @param [InvoiceEventData | Hash] The value against the validation is performed.
439
- def self.validate(value)
440
- return true if value.instance_of? self
441
-
442
- return false unless value.instance_of? Hash
443
-
444
- true
445
- end
446
- end
447
- end
@@ -1,168 +0,0 @@
1
- # advanced_billing
2
- #
3
- # This file was automatically generated by APIMATIC v2.0
4
- # ( https://apimatic.io ).
5
-
6
- module AdvancedBilling
7
- # A nested data structure detailing the method of payment
8
- class InvoiceEventPayment < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [String]
14
- attr_accessor :type
15
-
16
- # TODO: Write general description for this method
17
- # @return [String]
18
- attr_accessor :masked_account_number
19
-
20
- # TODO: Write general description for this method
21
- # @return [String]
22
- attr_accessor :masked_routing_number
23
-
24
- # TODO: Write general description for this method
25
- # @return [String]
26
- attr_accessor :card_brand
27
-
28
- # TODO: Write general description for this method
29
- # @return [String]
30
- attr_accessor :card_expiration
31
-
32
- # TODO: Write general description for this method
33
- # @return [String]
34
- attr_accessor :last_four
35
-
36
- # TODO: Write general description for this method
37
- # @return [String]
38
- attr_accessor :masked_card_number
39
-
40
- # TODO: Write general description for this method
41
- # @return [String]
42
- attr_accessor :details
43
-
44
- # TODO: Write general description for this method
45
- # @return [String]
46
- attr_accessor :kind
47
-
48
- # TODO: Write general description for this method
49
- # @return [String]
50
- attr_accessor :memo
51
-
52
- # TODO: Write general description for this method
53
- # @return [String]
54
- attr_accessor :email
55
-
56
- # A mapping from model property names to API property names.
57
- def self.names
58
- @_hash = {} if @_hash.nil?
59
- @_hash['type'] = 'type'
60
- @_hash['masked_account_number'] = 'masked_account_number'
61
- @_hash['masked_routing_number'] = 'masked_routing_number'
62
- @_hash['card_brand'] = 'card_brand'
63
- @_hash['card_expiration'] = 'card_expiration'
64
- @_hash['last_four'] = 'last_four'
65
- @_hash['masked_card_number'] = 'masked_card_number'
66
- @_hash['details'] = 'details'
67
- @_hash['kind'] = 'kind'
68
- @_hash['memo'] = 'memo'
69
- @_hash['email'] = 'email'
70
- @_hash
71
- end
72
-
73
- # An array for optional fields
74
- def self.optionals
75
- %w[
76
- type
77
- masked_account_number
78
- masked_routing_number
79
- card_brand
80
- card_expiration
81
- last_four
82
- masked_card_number
83
- details
84
- kind
85
- memo
86
- email
87
- ]
88
- end
89
-
90
- # An array for nullable fields
91
- def self.nullables
92
- %w[
93
- last_four
94
- details
95
- memo
96
- ]
97
- end
98
-
99
- def initialize(type = 'Invoice Event Payment',
100
- masked_account_number = SKIP,
101
- masked_routing_number = SKIP,
102
- card_brand = SKIP,
103
- card_expiration = SKIP,
104
- last_four = SKIP,
105
- masked_card_number = SKIP,
106
- details = SKIP,
107
- kind = SKIP,
108
- memo = SKIP,
109
- email = SKIP,
110
- additional_properties = {})
111
- @type = type unless type == SKIP
112
- @masked_account_number = masked_account_number unless masked_account_number == SKIP
113
- @masked_routing_number = masked_routing_number unless masked_routing_number == SKIP
114
- @card_brand = card_brand unless card_brand == SKIP
115
- @card_expiration = card_expiration unless card_expiration == SKIP
116
- @last_four = last_four unless last_four == SKIP
117
- @masked_card_number = masked_card_number unless masked_card_number == SKIP
118
- @details = details unless details == SKIP
119
- @kind = kind unless kind == SKIP
120
- @memo = memo unless memo == SKIP
121
- @email = email unless email == SKIP
122
-
123
- # Add additional model properties to the instance.
124
- additional_properties.each do |_name, _value|
125
- instance_variable_set("@#{_name}", _value)
126
- end
127
- end
128
-
129
- # Creates an instance of the object from a hash.
130
- def self.from_hash(hash)
131
- return nil unless hash
132
-
133
- # Extract variables from the hash.
134
- type = hash['type'] ||= 'Invoice Event Payment'
135
- masked_account_number =
136
- hash.key?('masked_account_number') ? hash['masked_account_number'] : SKIP
137
- masked_routing_number =
138
- hash.key?('masked_routing_number') ? hash['masked_routing_number'] : SKIP
139
- card_brand = hash.key?('card_brand') ? hash['card_brand'] : SKIP
140
- card_expiration =
141
- hash.key?('card_expiration') ? hash['card_expiration'] : SKIP
142
- last_four = hash.key?('last_four') ? hash['last_four'] : SKIP
143
- masked_card_number =
144
- hash.key?('masked_card_number') ? hash['masked_card_number'] : SKIP
145
- details = hash.key?('details') ? hash['details'] : SKIP
146
- kind = hash.key?('kind') ? hash['kind'] : SKIP
147
- memo = hash.key?('memo') ? hash['memo'] : SKIP
148
- email = hash.key?('email') ? hash['email'] : SKIP
149
-
150
- # Clean out expected properties from Hash.
151
- names.each_value { |k| hash.delete(k) }
152
-
153
- # Create object from extracted values.
154
- InvoiceEventPayment.new(type,
155
- masked_account_number,
156
- masked_routing_number,
157
- card_brand,
158
- card_expiration,
159
- last_four,
160
- masked_card_number,
161
- details,
162
- kind,
163
- memo,
164
- email,
165
- hash)
166
- end
167
- end
168
- end