maxio-advanced-billing-sdk 5.2.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (530) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -50
  3. data/lib/advanced_billing/client.rb +3 -4
  4. data/lib/advanced_billing/configuration.rb +21 -24
  5. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +3 -3
  6. data/lib/advanced_billing/controllers/api_exports_controller.rb +9 -9
  7. data/lib/advanced_billing/controllers/base_controller.rb +1 -1
  8. data/lib/advanced_billing/controllers/billing_portal_controller.rb +4 -4
  9. data/lib/advanced_billing/controllers/component_price_points_controller.rb +34 -20
  10. data/lib/advanced_billing/controllers/components_controller.rb +12 -12
  11. data/lib/advanced_billing/controllers/coupons_controller.rb +45 -27
  12. data/lib/advanced_billing/controllers/custom_fields_controller.rb +9 -9
  13. data/lib/advanced_billing/controllers/customers_controller.rb +7 -7
  14. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +6 -6
  15. data/lib/advanced_billing/controllers/events_controller.rb +26 -9
  16. data/lib/advanced_billing/controllers/insights_controller.rb +4 -4
  17. data/lib/advanced_billing/controllers/invoices_controller.rb +17 -17
  18. data/lib/advanced_billing/controllers/offers_controller.rb +10 -6
  19. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +12 -12
  20. data/lib/advanced_billing/controllers/product_families_controller.rb +22 -20
  21. data/lib/advanced_billing/controllers/product_price_points_controller.rb +14 -11
  22. data/lib/advanced_billing/controllers/products_controller.rb +6 -6
  23. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +9 -9
  24. data/lib/advanced_billing/controllers/reason_codes_controller.rb +17 -9
  25. data/lib/advanced_billing/controllers/referral_codes_controller.rb +1 -1
  26. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
  27. data/lib/advanced_billing/controllers/sites_controller.rb +3 -3
  28. data/lib/advanced_billing/controllers/subscription_components_controller.rb +21 -31
  29. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +4 -4
  30. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +4 -4
  31. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +9 -9
  32. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +6 -6
  33. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -8
  34. data/lib/advanced_billing/controllers/subscription_products_controller.rb +2 -2
  35. data/lib/advanced_billing/controllers/subscription_status_controller.rb +20 -12
  36. data/lib/advanced_billing/controllers/subscriptions_controller.rb +40 -17
  37. data/lib/advanced_billing/controllers/webhooks_controller.rb +6 -6
  38. data/lib/advanced_billing/exceptions/subscription_response_error_exception.rb +32 -0
  39. data/lib/advanced_billing/models/account_balance.rb +7 -7
  40. data/lib/advanced_billing/models/account_balances.rb +7 -7
  41. data/lib/advanced_billing/models/ach_agreement.rb +7 -7
  42. data/lib/advanced_billing/models/activate_event_based_component.rb +6 -6
  43. data/lib/advanced_billing/models/activate_subscription_request.rb +4 -4
  44. data/lib/advanced_billing/models/add_coupons_request.rb +4 -4
  45. data/lib/advanced_billing/models/add_subscription_to_a_group.rb +6 -18
  46. data/lib/advanced_billing/models/address_change.rb +5 -5
  47. data/lib/advanced_billing/models/agreement_acceptance.rb +7 -7
  48. data/lib/advanced_billing/models/allocate_components.rb +7 -7
  49. data/lib/advanced_billing/models/allocation.rb +7 -7
  50. data/lib/advanced_billing/models/allocation_expiration_date.rb +4 -4
  51. data/lib/advanced_billing/models/allocation_preview.rb +7 -7
  52. data/lib/advanced_billing/models/allocation_preview_item.rb +7 -7
  53. data/lib/advanced_billing/models/allocation_preview_line_item.rb +7 -7
  54. data/lib/advanced_billing/models/allocation_preview_response.rb +4 -4
  55. data/lib/advanced_billing/models/allocation_response.rb +4 -4
  56. data/lib/advanced_billing/models/allocation_settings.rb +6 -6
  57. data/lib/advanced_billing/models/apple_pay_payment_profile.rb +7 -7
  58. data/lib/advanced_billing/models/applied_credit_note_data.rb +5 -5
  59. data/lib/advanced_billing/models/apply_credit_note_event.rb +7 -7
  60. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +7 -7
  61. data/lib/advanced_billing/models/apply_debit_note_event.rb +7 -7
  62. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +7 -7
  63. data/lib/advanced_billing/models/apply_payment_event.rb +7 -7
  64. data/lib/advanced_billing/models/apply_payment_event_data.rb +7 -7
  65. data/lib/advanced_billing/models/attribute_error.rb +4 -4
  66. data/lib/advanced_billing/models/auto_resume.rb +4 -4
  67. data/lib/advanced_billing/models/backport_invoice_event.rb +7 -7
  68. data/lib/advanced_billing/models/bank_account_attributes.rb +7 -7
  69. data/lib/advanced_billing/models/bank_account_payment_profile.rb +7 -7
  70. data/lib/advanced_billing/models/bank_account_response.rb +4 -4
  71. data/lib/advanced_billing/models/bank_account_verification.rb +5 -5
  72. data/lib/advanced_billing/models/bank_account_verification_request.rb +4 -4
  73. data/lib/advanced_billing/models/base_model.rb +76 -28
  74. data/lib/advanced_billing/models/base_refund_error.rb +4 -4
  75. data/lib/advanced_billing/models/base_string_error.rb +4 -4
  76. data/lib/advanced_billing/models/batch_job.rb +7 -7
  77. data/lib/advanced_billing/models/batch_job_response.rb +4 -4
  78. data/lib/advanced_billing/models/billing_manifest.rb +7 -7
  79. data/lib/advanced_billing/models/billing_manifest_item.rb +7 -7
  80. data/lib/advanced_billing/models/billing_schedule.rb +4 -4
  81. data/lib/advanced_billing/models/breakouts.rb +7 -7
  82. data/lib/advanced_billing/models/bulk_components_price_point_assignment.rb +4 -4
  83. data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +4 -4
  84. data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +4 -4
  85. data/lib/advanced_billing/models/bulk_create_segments.rb +4 -4
  86. data/lib/advanced_billing/models/bulk_update_segments.rb +4 -4
  87. data/lib/advanced_billing/models/bulk_update_segments_item.rb +6 -6
  88. data/lib/advanced_billing/models/calendar_billing.rb +7 -7
  89. data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +4 -4
  90. data/lib/advanced_billing/models/cancellation_options.rb +5 -5
  91. data/lib/advanced_billing/models/cancellation_request.rb +4 -4
  92. data/lib/advanced_billing/models/change_chargeback_status_event.rb +7 -7
  93. data/lib/advanced_billing/models/change_chargeback_status_event_data.rb +4 -4
  94. data/lib/advanced_billing/models/change_invoice_collection_method_event.rb +7 -7
  95. data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +5 -5
  96. data/lib/advanced_billing/models/change_invoice_status_event.rb +7 -7
  97. data/lib/advanced_billing/models/change_invoice_status_event_data.rb +7 -7
  98. data/lib/advanced_billing/models/chargify_ebb.rb +7 -7
  99. data/lib/advanced_billing/models/component.rb +9 -9
  100. data/lib/advanced_billing/models/component_allocation_change.rb +7 -7
  101. data/lib/advanced_billing/models/component_allocation_error_item.rb +7 -7
  102. data/lib/advanced_billing/models/component_cost_data.rb +7 -7
  103. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +7 -7
  104. data/lib/advanced_billing/models/component_currency_price.rb +7 -7
  105. data/lib/advanced_billing/models/component_currency_prices_response.rb +4 -4
  106. data/lib/advanced_billing/models/component_custom_price.rb +7 -7
  107. data/lib/advanced_billing/models/component_price.rb +7 -7
  108. data/lib/advanced_billing/models/component_price_point.rb +92 -7
  109. data/lib/advanced_billing/models/component_price_point_assignment.rb +5 -5
  110. data/lib/advanced_billing/models/component_price_point_error_item.rb +6 -6
  111. data/lib/advanced_billing/models/component_price_point_item.rb +7 -7
  112. data/lib/advanced_billing/models/component_price_point_response.rb +4 -4
  113. data/lib/advanced_billing/models/component_price_points_response.rb +5 -5
  114. data/lib/advanced_billing/models/component_response.rb +4 -4
  115. data/lib/advanced_billing/models/compounding_strategy.rb +5 -1
  116. data/lib/advanced_billing/models/consolidated_invoice.rb +4 -4
  117. data/lib/advanced_billing/models/count_response.rb +4 -4
  118. data/lib/advanced_billing/models/coupon.rb +104 -29
  119. data/lib/advanced_billing/models/coupon_currency.rb +12 -9
  120. data/lib/advanced_billing/models/coupon_currency_request.rb +4 -4
  121. data/lib/advanced_billing/models/coupon_currency_response.rb +4 -4
  122. data/lib/advanced_billing/models/coupon_payload.rb +244 -0
  123. data/lib/advanced_billing/models/{create_or_update_coupon.rb → coupon_request.rb} +13 -25
  124. data/lib/advanced_billing/models/coupon_response.rb +4 -4
  125. data/lib/advanced_billing/models/coupon_restriction.rb +7 -7
  126. data/lib/advanced_billing/models/coupon_subcodes.rb +4 -4
  127. data/lib/advanced_billing/models/coupon_subcodes_response.rb +6 -6
  128. data/lib/advanced_billing/models/coupon_usage.rb +7 -7
  129. data/lib/advanced_billing/models/create_allocation.rb +7 -7
  130. data/lib/advanced_billing/models/create_allocation_request.rb +4 -4
  131. data/lib/advanced_billing/models/create_component_price_point.rb +11 -9
  132. data/lib/advanced_billing/models/create_component_price_point_request.rb +4 -4
  133. data/lib/advanced_billing/models/create_component_price_points_request.rb +4 -4
  134. data/lib/advanced_billing/models/create_credit_note_event.rb +7 -7
  135. data/lib/advanced_billing/models/create_currency_price.rb +6 -6
  136. data/lib/advanced_billing/models/create_currency_prices_request.rb +4 -4
  137. data/lib/advanced_billing/models/create_customer.rb +7 -7
  138. data/lib/advanced_billing/models/create_customer_request.rb +4 -4
  139. data/lib/advanced_billing/models/create_debit_note_event.rb +7 -7
  140. data/lib/advanced_billing/models/create_ebb_component.rb +4 -4
  141. data/lib/advanced_billing/models/create_invoice.rb +7 -7
  142. data/lib/advanced_billing/models/create_invoice_address.rb +7 -7
  143. data/lib/advanced_billing/models/create_invoice_coupon.rb +12 -8
  144. data/lib/advanced_billing/models/create_invoice_item.rb +7 -7
  145. data/lib/advanced_billing/models/create_invoice_payment.rb +7 -7
  146. data/lib/advanced_billing/models/create_invoice_payment_application.rb +5 -5
  147. data/lib/advanced_billing/models/create_invoice_payment_request.rb +5 -5
  148. data/lib/advanced_billing/models/create_invoice_request.rb +4 -4
  149. data/lib/advanced_billing/models/create_metadata.rb +5 -5
  150. data/lib/advanced_billing/models/create_metadata_request.rb +4 -4
  151. data/lib/advanced_billing/models/create_metafield.rb +7 -7
  152. data/lib/advanced_billing/models/create_metafields_request.rb +4 -4
  153. data/lib/advanced_billing/models/create_metered_component.rb +4 -4
  154. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +7 -7
  155. data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +4 -4
  156. data/lib/advanced_billing/models/create_offer.rb +7 -7
  157. data/lib/advanced_billing/models/create_offer_component.rb +6 -6
  158. data/lib/advanced_billing/models/create_offer_request.rb +4 -4
  159. data/lib/advanced_billing/models/create_on_off_component.rb +4 -4
  160. data/lib/advanced_billing/models/create_or_update_endpoint.rb +5 -5
  161. data/lib/advanced_billing/models/create_or_update_endpoint_request.rb +4 -4
  162. data/lib/advanced_billing/models/create_or_update_product.rb +7 -7
  163. data/lib/advanced_billing/models/create_or_update_product_request.rb +4 -4
  164. data/lib/advanced_billing/models/create_or_update_segment_price.rb +6 -6
  165. data/lib/advanced_billing/models/create_payment.rb +7 -7
  166. data/lib/advanced_billing/models/create_payment_profile.rb +7 -7
  167. data/lib/advanced_billing/models/create_payment_profile_request.rb +4 -4
  168. data/lib/advanced_billing/models/create_prepaid_component.rb +4 -4
  169. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +14 -13
  170. data/lib/advanced_billing/models/create_prepayment.rb +7 -7
  171. data/lib/advanced_billing/models/create_prepayment_request.rb +4 -4
  172. data/lib/advanced_billing/models/create_prepayment_response.rb +4 -4
  173. data/lib/advanced_billing/models/create_product_currency_price.rb +6 -6
  174. data/lib/advanced_billing/models/create_product_currency_prices_request.rb +4 -4
  175. data/lib/advanced_billing/models/create_product_family.rb +6 -6
  176. data/lib/advanced_billing/models/create_product_family_request.rb +4 -4
  177. data/lib/advanced_billing/models/create_product_price_point.rb +7 -7
  178. data/lib/advanced_billing/models/create_product_price_point_request.rb +4 -4
  179. data/lib/advanced_billing/models/create_quantity_based_component.rb +4 -4
  180. data/lib/advanced_billing/models/create_reason_code.rb +6 -6
  181. data/lib/advanced_billing/models/create_reason_code_request.rb +4 -4
  182. data/lib/advanced_billing/models/create_segment.rb +7 -7
  183. data/lib/advanced_billing/models/create_segment_request.rb +4 -4
  184. data/lib/advanced_billing/models/create_subscription.rb +7 -8
  185. data/lib/advanced_billing/models/create_subscription_component.rb +7 -7
  186. data/lib/advanced_billing/models/create_subscription_group.rb +5 -5
  187. data/lib/advanced_billing/models/create_subscription_group_request.rb +4 -4
  188. data/lib/advanced_billing/models/create_subscription_request.rb +4 -4
  189. data/lib/advanced_billing/models/create_usage.rb +7 -7
  190. data/lib/advanced_billing/models/create_usage_request.rb +4 -4
  191. data/lib/advanced_billing/models/created_prepayment.rb +7 -7
  192. data/lib/advanced_billing/models/credit_account_balance_changed.rb +7 -7
  193. data/lib/advanced_billing/models/credit_card_attributes.rb +6 -6
  194. data/lib/advanced_billing/models/credit_card_payment_profile.rb +7 -7
  195. data/lib/advanced_billing/models/credit_note.rb +7 -7
  196. data/lib/advanced_billing/models/credit_note_application.rb +7 -7
  197. data/lib/advanced_billing/models/credit_note_line_item.rb +7 -7
  198. data/lib/advanced_billing/models/credit_scheme_request.rb +4 -4
  199. data/lib/advanced_billing/models/currency_price.rb +27 -7
  200. data/lib/advanced_billing/models/currency_prices_response.rb +4 -4
  201. data/lib/advanced_billing/models/custom_field_value_change.rb +7 -7
  202. data/lib/advanced_billing/models/customer.rb +7 -7
  203. data/lib/advanced_billing/models/customer_attributes.rb +7 -7
  204. data/lib/advanced_billing/models/customer_change.rb +7 -7
  205. data/lib/advanced_billing/models/customer_changes_preview_response.rb +4 -4
  206. data/lib/advanced_billing/models/customer_custom_fields_change.rb +5 -5
  207. data/lib/advanced_billing/models/customer_error.rb +4 -4
  208. data/lib/advanced_billing/models/customer_payer_change.rb +5 -5
  209. data/lib/advanced_billing/models/customer_response.rb +4 -4
  210. data/lib/advanced_billing/models/debit_note.rb +7 -7
  211. data/lib/advanced_billing/models/deduct_service_credit.rb +5 -5
  212. data/lib/advanced_billing/models/deduct_service_credit_request.rb +4 -4
  213. data/lib/advanced_billing/models/delayed_cancellation_response.rb +4 -4
  214. data/lib/advanced_billing/models/delete_subscription_group_response.rb +5 -5
  215. data/lib/advanced_billing/models/dunner_data.rb +7 -7
  216. data/lib/advanced_billing/models/dunning_step_data.rb +7 -7
  217. data/lib/advanced_billing/models/dunning_step_reached.rb +6 -6
  218. data/lib/advanced_billing/models/ebb_component.rb +17 -53
  219. data/lib/advanced_billing/models/ebb_event.rb +4 -4
  220. data/lib/advanced_billing/models/enable_webhooks_request.rb +4 -4
  221. data/lib/advanced_billing/models/enable_webhooks_response.rb +4 -4
  222. data/lib/advanced_billing/models/endpoint.rb +7 -7
  223. data/lib/advanced_billing/models/endpoint_response.rb +4 -4
  224. data/lib/advanced_billing/models/errors.rb +5 -5
  225. data/lib/advanced_billing/models/event.rb +71 -11
  226. data/lib/advanced_billing/models/event_based_billing_segment_error.rb +4 -4
  227. data/lib/advanced_billing/models/event_key.rb +264 -0
  228. data/lib/advanced_billing/models/event_response.rb +4 -4
  229. data/lib/advanced_billing/models/failed_payment_event.rb +7 -7
  230. data/lib/advanced_billing/models/failed_payment_event_data.rb +7 -7
  231. data/lib/advanced_billing/models/full_subscription_group_response.rb +7 -7
  232. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +7 -7
  233. data/lib/advanced_billing/models/get_one_time_token_request.rb +4 -4
  234. data/lib/advanced_billing/models/group_billing.rb +6 -6
  235. data/lib/advanced_billing/models/group_settings.rb +5 -5
  236. data/lib/advanced_billing/models/group_target.rb +5 -5
  237. data/lib/advanced_billing/models/historic_usage.rb +6 -6
  238. data/lib/advanced_billing/models/invoice.rb +52 -13
  239. data/lib/advanced_billing/models/invoice_address.rb +7 -7
  240. data/lib/advanced_billing/models/invoice_avatax_details.rb +130 -0
  241. data/lib/advanced_billing/models/invoice_balance_item.rb +6 -6
  242. data/lib/advanced_billing/models/invoice_credit.rb +7 -7
  243. data/lib/advanced_billing/models/invoice_custom_field.rb +7 -7
  244. data/lib/advanced_billing/models/invoice_customer.rb +7 -7
  245. data/lib/advanced_billing/models/invoice_debit.rb +148 -0
  246. data/lib/advanced_billing/models/invoice_discount.rb +7 -7
  247. data/lib/advanced_billing/models/invoice_discount_breakout.rb +6 -6
  248. data/lib/advanced_billing/models/invoice_display_settings.rb +7 -7
  249. data/lib/advanced_billing/models/invoice_issued.rb +7 -7
  250. data/lib/advanced_billing/models/invoice_line_item.rb +21 -8
  251. data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +4 -4
  252. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +7 -7
  253. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +5 -5
  254. data/lib/advanced_billing/models/invoice_payer.rb +7 -7
  255. data/lib/advanced_billing/models/invoice_payer_change.rb +7 -7
  256. data/lib/advanced_billing/models/invoice_payment.rb +7 -7
  257. data/lib/advanced_billing/models/invoice_payment_application.rb +6 -6
  258. data/lib/advanced_billing/models/invoice_payment_method.rb +7 -7
  259. data/lib/advanced_billing/models/invoice_pre_payment.rb +6 -6
  260. data/lib/advanced_billing/models/invoice_previous_balance.rb +5 -5
  261. data/lib/advanced_billing/models/invoice_refund.rb +7 -7
  262. data/lib/advanced_billing/models/invoice_response.rb +4 -4
  263. data/lib/advanced_billing/models/invoice_seller.rb +7 -7
  264. data/lib/advanced_billing/models/invoice_status.rb +4 -1
  265. data/lib/advanced_billing/models/invoice_tax.rb +7 -7
  266. data/lib/advanced_billing/models/invoice_tax_breakout.rb +7 -7
  267. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +7 -7
  268. data/lib/advanced_billing/models/issue_advance_invoice_request.rb +4 -4
  269. data/lib/advanced_billing/models/issue_invoice_event.rb +7 -7
  270. data/lib/advanced_billing/models/issue_invoice_event_data.rb +7 -7
  271. data/lib/advanced_billing/models/issue_invoice_request.rb +4 -4
  272. data/lib/advanced_billing/models/issue_service_credit.rb +5 -5
  273. data/lib/advanced_billing/models/issue_service_credit_request.rb +4 -4
  274. data/lib/advanced_billing/models/item_price_point_changed.rb +7 -7
  275. data/lib/advanced_billing/models/item_price_point_data.rb +6 -6
  276. data/lib/advanced_billing/models/list_components_filter.rb +5 -5
  277. data/lib/advanced_billing/models/list_components_price_points_response.rb +4 -4
  278. data/lib/advanced_billing/models/list_coupons_filter.rb +7 -7
  279. data/lib/advanced_billing/models/list_credit_notes_response.rb +4 -4
  280. data/lib/advanced_billing/models/list_invoice_events_response.rb +7 -7
  281. data/lib/advanced_billing/models/list_invoices_response.rb +4 -4
  282. data/lib/advanced_billing/models/list_metafields_response.rb +7 -7
  283. data/lib/advanced_billing/models/list_mrr_filter.rb +4 -4
  284. data/lib/advanced_billing/models/list_mrr_response.rb +4 -4
  285. data/lib/advanced_billing/models/list_mrr_response_result.rb +7 -7
  286. data/lib/advanced_billing/models/list_offers_response.rb +4 -4
  287. data/lib/advanced_billing/models/list_prepayments_filter.rb +6 -6
  288. data/lib/advanced_billing/models/list_price_points_filter.rb +7 -7
  289. data/lib/advanced_billing/models/list_product_price_points_response.rb +4 -4
  290. data/lib/advanced_billing/models/list_products_filter.rb +7 -7
  291. data/lib/advanced_billing/models/list_proforma_invoices_meta.rb +7 -7
  292. data/lib/advanced_billing/models/list_proforma_invoices_response.rb +5 -5
  293. data/lib/advanced_billing/models/list_public_keys_meta.rb +7 -7
  294. data/lib/advanced_billing/models/list_public_keys_response.rb +5 -5
  295. data/lib/advanced_billing/models/list_sale_rep_item.rb +7 -7
  296. data/lib/advanced_billing/models/list_segments_filter.rb +7 -7
  297. data/lib/advanced_billing/models/list_segments_response.rb +4 -4
  298. data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +7 -7
  299. data/lib/advanced_billing/models/list_subscription_components_filter.rb +5 -5
  300. data/lib/advanced_billing/models/list_subscription_components_for_site_filter.rb +6 -6
  301. data/lib/advanced_billing/models/list_subscription_components_response.rb +4 -4
  302. data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +4 -4
  303. data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +4 -4
  304. data/lib/advanced_billing/models/list_subscription_groups_item.rb +7 -7
  305. data/lib/advanced_billing/models/list_subscription_groups_meta.rb +5 -5
  306. data/lib/advanced_billing/models/list_subscription_groups_response.rb +5 -5
  307. data/lib/advanced_billing/models/metadata.rb +7 -7
  308. data/lib/advanced_billing/models/metafield.rb +7 -7
  309. data/lib/advanced_billing/models/metafield_scope.rb +7 -7
  310. data/lib/advanced_billing/models/metered_component.rb +22 -51
  311. data/lib/advanced_billing/models/metered_usage.rb +7 -7
  312. data/lib/advanced_billing/models/movement.rb +7 -7
  313. data/lib/advanced_billing/models/movement_line_item.rb +7 -7
  314. data/lib/advanced_billing/models/mrr.rb +7 -7
  315. data/lib/advanced_billing/models/mrr_movement.rb +7 -7
  316. data/lib/advanced_billing/models/mrr_response.rb +4 -4
  317. data/lib/advanced_billing/models/multi_invoice_payment.rb +7 -7
  318. data/lib/advanced_billing/models/multi_invoice_payment_response.rb +4 -4
  319. data/lib/advanced_billing/models/nested_subscription_group.rb +7 -7
  320. data/lib/advanced_billing/models/net_terms.rb +7 -7
  321. data/lib/advanced_billing/models/offer.rb +7 -7
  322. data/lib/advanced_billing/models/offer_discount.rb +6 -6
  323. data/lib/advanced_billing/models/offer_item.rb +7 -7
  324. data/lib/advanced_billing/models/offer_response.rb +4 -4
  325. data/lib/advanced_billing/models/offer_signup_page.rb +7 -7
  326. data/lib/advanced_billing/models/{reason_codes_json_response.rb → ok_response.rb} +7 -7
  327. data/lib/advanced_billing/models/on_off_component.rb +40 -61
  328. data/lib/advanced_billing/models/organization_address.rb +7 -7
  329. data/lib/advanced_billing/models/origin_invoice.rb +5 -5
  330. data/lib/advanced_billing/models/overage_pricing.rb +5 -5
  331. data/lib/advanced_billing/models/override_subscription.rb +7 -7
  332. data/lib/advanced_billing/models/override_subscription_request.rb +4 -4
  333. data/lib/advanced_billing/models/paginated_metadata.rb +7 -7
  334. data/lib/advanced_billing/models/paid_invoice.rb +7 -7
  335. data/lib/advanced_billing/models/pause_request.rb +4 -4
  336. data/lib/advanced_billing/models/payer_attributes.rb +7 -7
  337. data/lib/advanced_billing/models/payer_error.rb +6 -6
  338. data/lib/advanced_billing/models/payment_collection_method_changed.rb +5 -5
  339. data/lib/advanced_billing/models/payment_for_allocation.rb +7 -7
  340. data/lib/advanced_billing/models/payment_method_apple_pay.rb +4 -4
  341. data/lib/advanced_billing/models/payment_method_bank_account.rb +6 -6
  342. data/lib/advanced_billing/models/payment_method_credit_card.rb +7 -7
  343. data/lib/advanced_billing/models/payment_method_external.rb +7 -7
  344. data/lib/advanced_billing/models/payment_method_paypal.rb +5 -5
  345. data/lib/advanced_billing/models/payment_profile_attributes.rb +7 -7
  346. data/lib/advanced_billing/models/payment_profile_response.rb +4 -4
  347. data/lib/advanced_billing/models/payment_related_events.rb +5 -5
  348. data/lib/advanced_billing/models/paypal_payment_profile.rb +7 -7
  349. data/lib/advanced_billing/models/pending_cancellation_change.rb +5 -5
  350. data/lib/advanced_billing/models/portal_management_link.rb +7 -7
  351. data/lib/advanced_billing/models/prepaid_configuration.rb +7 -7
  352. data/lib/advanced_billing/models/prepaid_configuration_response.rb +4 -4
  353. data/lib/advanced_billing/models/prepaid_product_price_point_filter.rb +4 -4
  354. data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +7 -7
  355. data/lib/advanced_billing/models/prepaid_usage.rb +7 -7
  356. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +6 -6
  357. data/lib/advanced_billing/models/prepaid_usage_component.rb +48 -41
  358. data/lib/advanced_billing/models/prepayment.rb +7 -7
  359. data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +7 -7
  360. data/lib/advanced_billing/models/prepayment_response.rb +4 -4
  361. data/lib/advanced_billing/models/prepayments_response.rb +4 -4
  362. data/lib/advanced_billing/models/preview_allocations_request.rb +7 -7
  363. data/lib/advanced_billing/models/price.rb +6 -6
  364. data/lib/advanced_billing/models/product.rb +7 -7
  365. data/lib/advanced_billing/models/product_family.rb +7 -7
  366. data/lib/advanced_billing/models/product_family_response.rb +4 -4
  367. data/lib/advanced_billing/models/product_price_point.rb +7 -7
  368. data/lib/advanced_billing/models/product_price_point_errors.rb +7 -7
  369. data/lib/advanced_billing/models/product_price_point_response.rb +4 -4
  370. data/lib/advanced_billing/models/product_response.rb +4 -4
  371. data/lib/advanced_billing/models/proforma_error.rb +4 -4
  372. data/lib/advanced_billing/models/proforma_invoice.rb +7 -7
  373. data/lib/advanced_billing/models/proforma_invoice_credit.rb +7 -7
  374. data/lib/advanced_billing/models/proforma_invoice_discount.rb +7 -7
  375. data/lib/advanced_billing/models/proforma_invoice_issued.rb +7 -7
  376. data/lib/advanced_billing/models/proforma_invoice_payment.rb +7 -7
  377. data/lib/advanced_billing/models/proforma_invoice_tax.rb +7 -7
  378. data/lib/advanced_billing/models/proration.rb +4 -4
  379. data/lib/advanced_billing/models/public_key.rb +6 -6
  380. data/lib/advanced_billing/models/public_signup_page.rb +7 -7
  381. data/lib/advanced_billing/models/quantity_based_component.rb +21 -23
  382. data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +5 -5
  383. data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +7 -7
  384. data/lib/advanced_billing/models/reactivate_subscription_request.rb +7 -7
  385. data/lib/advanced_billing/models/reactivation_billing.rb +4 -4
  386. data/lib/advanced_billing/models/reason_code.rb +7 -7
  387. data/lib/advanced_billing/models/reason_code_response.rb +4 -4
  388. data/lib/advanced_billing/models/record_payment_request.rb +4 -4
  389. data/lib/advanced_billing/models/record_payment_response.rb +5 -5
  390. data/lib/advanced_billing/models/referral_code.rb +7 -7
  391. data/lib/advanced_billing/models/referral_validation_response.rb +4 -4
  392. data/lib/advanced_billing/models/refund_consolidated_invoice.rb +7 -7
  393. data/lib/advanced_billing/models/refund_invoice.rb +7 -7
  394. data/lib/advanced_billing/models/refund_invoice_event.rb +7 -7
  395. data/lib/advanced_billing/models/refund_invoice_event_data.rb +7 -7
  396. data/lib/advanced_billing/models/refund_invoice_request.rb +4 -4
  397. data/lib/advanced_billing/models/refund_prepayment.rb +7 -7
  398. data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +4 -4
  399. data/lib/advanced_billing/models/refund_prepayment_request.rb +4 -4
  400. data/lib/advanced_billing/models/refund_success.rb +6 -6
  401. data/lib/advanced_billing/models/remove_payment_event.rb +7 -7
  402. data/lib/advanced_billing/models/remove_payment_event_data.rb +7 -7
  403. data/lib/advanced_billing/models/renewal_preview.rb +7 -7
  404. data/lib/advanced_billing/models/renewal_preview_component.rb +6 -6
  405. data/lib/advanced_billing/models/renewal_preview_line_item.rb +7 -7
  406. data/lib/advanced_billing/models/renewal_preview_request.rb +4 -4
  407. data/lib/advanced_billing/models/renewal_preview_response.rb +4 -4
  408. data/lib/advanced_billing/models/replay_webhooks_request.rb +4 -4
  409. data/lib/advanced_billing/models/replay_webhooks_response.rb +4 -4
  410. data/lib/advanced_billing/models/resent_invitation.rb +7 -7
  411. data/lib/advanced_billing/models/resume_options.rb +5 -5
  412. data/lib/advanced_billing/models/revoked_invitation.rb +6 -6
  413. data/lib/advanced_billing/models/sale_rep.rb +7 -7
  414. data/lib/advanced_billing/models/sale_rep_item_mrr.rb +6 -6
  415. data/lib/advanced_billing/models/sale_rep_settings.rb +7 -7
  416. data/lib/advanced_billing/models/sale_rep_subscription.rb +7 -7
  417. data/lib/advanced_billing/models/segment.rb +7 -7
  418. data/lib/advanced_billing/models/segment_price.rb +7 -7
  419. data/lib/advanced_billing/models/segment_response.rb +4 -4
  420. data/lib/advanced_billing/models/send_invoice_request.rb +6 -6
  421. data/lib/advanced_billing/models/service_credit.rb +7 -7
  422. data/lib/advanced_billing/models/service_credit_response.rb +4 -4
  423. data/lib/advanced_billing/models/signup_proforma_preview.rb +5 -5
  424. data/lib/advanced_billing/models/signup_proforma_preview_response.rb +4 -4
  425. data/lib/advanced_billing/models/site.rb +7 -7
  426. data/lib/advanced_billing/models/site_response.rb +4 -4
  427. data/lib/advanced_billing/models/site_statistics.rb +7 -7
  428. data/lib/advanced_billing/models/site_summary.rb +7 -7
  429. data/lib/advanced_billing/models/subscription.rb +7 -7
  430. data/lib/advanced_billing/models/subscription_component.rb +7 -7
  431. data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +5 -5
  432. data/lib/advanced_billing/models/subscription_component_response.rb +4 -4
  433. data/lib/advanced_billing/models/subscription_component_subscription.rb +5 -5
  434. data/lib/advanced_billing/models/subscription_custom_price.rb +7 -7
  435. data/lib/advanced_billing/models/subscription_filter.rb +7 -7
  436. data/lib/advanced_billing/models/subscription_group.rb +7 -7
  437. data/lib/advanced_billing/models/subscription_group_balances.rb +7 -7
  438. data/lib/advanced_billing/models/subscription_group_bank_account.rb +7 -7
  439. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +6 -6
  440. data/lib/advanced_billing/models/subscription_group_credit_card.rb +7 -7
  441. data/lib/advanced_billing/models/subscription_group_customer.rb +7 -7
  442. data/lib/advanced_billing/models/subscription_group_item.rb +7 -7
  443. data/lib/advanced_billing/models/subscription_group_members_array_error.rb +4 -4
  444. data/lib/advanced_billing/models/subscription_group_payment_profile.rb +7 -7
  445. data/lib/advanced_billing/models/subscription_group_prepayment.rb +7 -7
  446. data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +4 -4
  447. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +7 -7
  448. data/lib/advanced_billing/models/subscription_group_response.rb +4 -4
  449. data/lib/advanced_billing/models/subscription_group_signup.rb +7 -7
  450. data/lib/advanced_billing/models/subscription_group_signup_component.rb +7 -7
  451. data/lib/advanced_billing/models/subscription_group_signup_error.rb +7 -7
  452. data/lib/advanced_billing/models/{subscription_group_signup_success.rb → subscription_group_signup_event_data.rb} +17 -15
  453. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +7 -7
  454. data/lib/advanced_billing/models/subscription_group_signup_item.rb +7 -7
  455. data/lib/advanced_billing/models/subscription_group_signup_request.rb +4 -4
  456. data/lib/advanced_billing/models/subscription_group_signup_response.rb +7 -7
  457. data/lib/advanced_billing/models/subscription_group_single_error.rb +4 -4
  458. data/lib/advanced_billing/models/subscription_group_subscription_error.rb +7 -7
  459. data/lib/advanced_billing/models/subscription_group_update_error.rb +6 -15
  460. data/lib/advanced_billing/models/subscription_included_coupon.rb +7 -7
  461. data/lib/advanced_billing/models/subscription_migration_preview.rb +7 -7
  462. data/lib/advanced_billing/models/subscription_migration_preview_options.rb +7 -7
  463. data/lib/advanced_billing/models/subscription_migration_preview_request.rb +4 -4
  464. data/lib/advanced_billing/models/subscription_migration_preview_response.rb +4 -4
  465. data/lib/advanced_billing/models/subscription_mrr.rb +6 -6
  466. data/lib/advanced_billing/models/subscription_mrr_breakout.rb +5 -5
  467. data/lib/advanced_billing/models/subscription_mrr_response.rb +4 -4
  468. data/lib/advanced_billing/models/subscription_note.rb +7 -7
  469. data/lib/advanced_billing/models/subscription_note_response.rb +4 -4
  470. data/lib/advanced_billing/models/subscription_preview.rb +5 -5
  471. data/lib/advanced_billing/models/subscription_preview_response.rb +4 -4
  472. data/lib/advanced_billing/models/subscription_product_change.rb +5 -5
  473. data/lib/advanced_billing/models/subscription_product_migration.rb +7 -7
  474. data/lib/advanced_billing/models/subscription_product_migration_request.rb +4 -4
  475. data/lib/advanced_billing/models/subscription_response.rb +4 -4
  476. data/lib/advanced_billing/models/subscription_state_change.rb +5 -5
  477. data/lib/advanced_billing/models/tax_configuration.rb +6 -6
  478. data/lib/advanced_billing/models/too_many_management_link_requests.rb +5 -5
  479. data/lib/advanced_billing/models/update_allocation_expiration_date.rb +4 -4
  480. data/lib/advanced_billing/models/update_component.rb +7 -7
  481. data/lib/advanced_billing/models/update_component_price_point.rb +7 -7
  482. data/lib/advanced_billing/models/update_component_price_point_request.rb +4 -4
  483. data/lib/advanced_billing/models/update_component_request.rb +4 -4
  484. data/lib/advanced_billing/models/update_coupon_currency.rb +5 -5
  485. data/lib/advanced_billing/models/update_currency_price.rb +6 -6
  486. data/lib/advanced_billing/models/update_currency_prices_request.rb +4 -4
  487. data/lib/advanced_billing/models/update_customer.rb +7 -7
  488. data/lib/advanced_billing/models/update_customer_request.rb +4 -4
  489. data/lib/advanced_billing/models/update_metadata.rb +6 -6
  490. data/lib/advanced_billing/models/update_metadata_request.rb +4 -4
  491. data/lib/advanced_billing/models/update_metafield.rb +7 -7
  492. data/lib/advanced_billing/models/update_metafields_request.rb +4 -4
  493. data/lib/advanced_billing/models/update_payment_profile.rb +7 -7
  494. data/lib/advanced_billing/models/update_payment_profile_request.rb +4 -4
  495. data/lib/advanced_billing/models/update_price.rb +7 -7
  496. data/lib/advanced_billing/models/update_product_price_point.rb +5 -5
  497. data/lib/advanced_billing/models/update_product_price_point_request.rb +4 -4
  498. data/lib/advanced_billing/models/update_reason_code.rb +6 -6
  499. data/lib/advanced_billing/models/update_reason_code_request.rb +4 -4
  500. data/lib/advanced_billing/models/update_segment.rb +5 -5
  501. data/lib/advanced_billing/models/update_segment_request.rb +4 -4
  502. data/lib/advanced_billing/models/update_subscription.rb +7 -8
  503. data/lib/advanced_billing/models/update_subscription_component.rb +5 -5
  504. data/lib/advanced_billing/models/update_subscription_group.rb +4 -4
  505. data/lib/advanced_billing/models/update_subscription_group_request.rb +4 -4
  506. data/lib/advanced_billing/models/update_subscription_note.rb +5 -5
  507. data/lib/advanced_billing/models/update_subscription_note_request.rb +4 -4
  508. data/lib/advanced_billing/models/update_subscription_request.rb +4 -4
  509. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +7 -7
  510. data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +4 -4
  511. data/lib/advanced_billing/models/usage.rb +7 -7
  512. data/lib/advanced_billing/models/usage_response.rb +4 -4
  513. data/lib/advanced_billing/models/void_invoice.rb +4 -4
  514. data/lib/advanced_billing/models/void_invoice_event.rb +7 -7
  515. data/lib/advanced_billing/models/void_invoice_event_data.rb +7 -7
  516. data/lib/advanced_billing/models/void_invoice_request.rb +4 -4
  517. data/lib/advanced_billing/models/void_remainder_event.rb +7 -7
  518. data/lib/advanced_billing/models/void_remainder_event_data.rb +7 -7
  519. data/lib/advanced_billing/models/webhook.rb +7 -7
  520. data/lib/advanced_billing/models/webhook_response.rb +4 -4
  521. data/lib/advanced_billing/utilities/union_type_lookup.rb +12 -33
  522. data/lib/advanced_billing.rb +9 -11
  523. metadata +12 -14
  524. data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +0 -249
  525. data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +0 -250
  526. data/lib/advanced_billing/models/event_type.rb +0 -121
  527. data/lib/advanced_billing/models/prepaid_component_price_point.rb +0 -123
  528. data/lib/advanced_billing/models/subscription_group_member_error.rb +0 -78
  529. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +0 -93
  530. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +0 -185
@@ -221,6 +221,11 @@ module AdvancedBilling
221
221
  # @return [String]
222
222
  attr_accessor :credit_amount
223
223
 
224
+ # The amount of credit (from credit notes) applied to this invoice.
225
+ # Credits offset the amount due from the customer.
226
+ # @return [String]
227
+ attr_accessor :debit_amount
228
+
224
229
  # The amount of credit (from credit notes) applied to this invoice.
225
230
  # Credits offset the amount due from the customer.
226
231
  # @return [String]
@@ -251,6 +256,10 @@ module AdvancedBilling
251
256
  # @return [Array[InvoiceCredit]]
252
257
  attr_accessor :credits
253
258
 
259
+ # Line items on the invoice.
260
+ # @return [Array[InvoiceDebit]]
261
+ attr_accessor :debits
262
+
254
263
  # Line items on the invoice.
255
264
  # @return [Array[InvoiceRefund]]
256
265
  attr_accessor :refunds
@@ -267,6 +276,10 @@ module AdvancedBilling
267
276
  # @return [InvoiceDisplaySettings]
268
277
  attr_accessor :display_settings
269
278
 
279
+ # Line items on the invoice.
280
+ # @return [InvoiceAvataxDetails]
281
+ attr_accessor :avatax_details
282
+
270
283
  # The public URL of the invoice
271
284
  # @return [String]
272
285
  attr_accessor :public_url
@@ -322,6 +335,7 @@ module AdvancedBilling
322
335
  @_hash['tax_amount'] = 'tax_amount'
323
336
  @_hash['total_amount'] = 'total_amount'
324
337
  @_hash['credit_amount'] = 'credit_amount'
338
+ @_hash['debit_amount'] = 'debit_amount'
325
339
  @_hash['refund_amount'] = 'refund_amount'
326
340
  @_hash['paid_amount'] = 'paid_amount'
327
341
  @_hash['due_amount'] = 'due_amount'
@@ -329,10 +343,12 @@ module AdvancedBilling
329
343
  @_hash['discounts'] = 'discounts'
330
344
  @_hash['taxes'] = 'taxes'
331
345
  @_hash['credits'] = 'credits'
346
+ @_hash['debits'] = 'debits'
332
347
  @_hash['refunds'] = 'refunds'
333
348
  @_hash['payments'] = 'payments'
334
349
  @_hash['custom_fields'] = 'custom_fields'
335
350
  @_hash['display_settings'] = 'display_settings'
351
+ @_hash['avatax_details'] = 'avatax_details'
336
352
  @_hash['public_url'] = 'public_url'
337
353
  @_hash['previous_balance_data'] = 'previous_balance_data'
338
354
  @_hash['public_url_expires_on'] = 'public_url_expires_on'
@@ -381,6 +397,7 @@ module AdvancedBilling
381
397
  tax_amount
382
398
  total_amount
383
399
  credit_amount
400
+ debit_amount
384
401
  refund_amount
385
402
  paid_amount
386
403
  due_amount
@@ -388,10 +405,12 @@ module AdvancedBilling
388
405
  discounts
389
406
  taxes
390
407
  credits
408
+ debits
391
409
  refunds
392
410
  payments
393
411
  custom_fields
394
412
  display_settings
413
+ avatax_details
395
414
  public_url
396
415
  previous_balance_data
397
416
  public_url_expires_on
@@ -425,12 +444,18 @@ module AdvancedBilling
425
444
  memo: SKIP, billing_address: SKIP, shipping_address: SKIP,
426
445
  subtotal_amount: SKIP, discount_amount: SKIP,
427
446
  tax_amount: SKIP, total_amount: SKIP, credit_amount: SKIP,
428
- refund_amount: SKIP, paid_amount: SKIP, due_amount: SKIP,
429
- line_items: SKIP, discounts: SKIP, taxes: SKIP,
430
- credits: SKIP, refunds: SKIP, payments: SKIP,
431
- custom_fields: SKIP, display_settings: SKIP,
432
- public_url: SKIP, previous_balance_data: SKIP,
433
- public_url_expires_on: SKIP, additional_properties: {})
447
+ debit_amount: SKIP, refund_amount: SKIP, paid_amount: SKIP,
448
+ due_amount: SKIP, line_items: SKIP, discounts: SKIP,
449
+ taxes: SKIP, credits: SKIP, debits: SKIP, refunds: SKIP,
450
+ payments: SKIP, custom_fields: SKIP, display_settings: SKIP,
451
+ avatax_details: SKIP, public_url: SKIP,
452
+ previous_balance_data: SKIP, public_url_expires_on: SKIP,
453
+ additional_properties: {})
454
+ # Add additional model properties to the instance.
455
+ additional_properties.each do |_name, _value|
456
+ instance_variable_set("@#{_name}", _value)
457
+ end
458
+
434
459
  @id = id unless id == SKIP
435
460
  @uid = uid unless uid == SKIP
436
461
  @site_id = site_id unless site_id == SKIP
@@ -473,6 +498,7 @@ module AdvancedBilling
473
498
  @tax_amount = tax_amount unless tax_amount == SKIP
474
499
  @total_amount = total_amount unless total_amount == SKIP
475
500
  @credit_amount = credit_amount unless credit_amount == SKIP
501
+ @debit_amount = debit_amount unless debit_amount == SKIP
476
502
  @refund_amount = refund_amount unless refund_amount == SKIP
477
503
  @paid_amount = paid_amount unless paid_amount == SKIP
478
504
  @due_amount = due_amount unless due_amount == SKIP
@@ -480,18 +506,15 @@ module AdvancedBilling
480
506
  @discounts = discounts unless discounts == SKIP
481
507
  @taxes = taxes unless taxes == SKIP
482
508
  @credits = credits unless credits == SKIP
509
+ @debits = debits unless debits == SKIP
483
510
  @refunds = refunds unless refunds == SKIP
484
511
  @payments = payments unless payments == SKIP
485
512
  @custom_fields = custom_fields unless custom_fields == SKIP
486
513
  @display_settings = display_settings unless display_settings == SKIP
514
+ @avatax_details = avatax_details unless avatax_details == SKIP
487
515
  @public_url = public_url unless public_url == SKIP
488
516
  @previous_balance_data = previous_balance_data unless previous_balance_data == SKIP
489
517
  @public_url_expires_on = public_url_expires_on unless public_url_expires_on == SKIP
490
-
491
- # Add additional model properties to the instance.
492
- additional_properties.each do |_name, _value|
493
- instance_variable_set("@#{_name}", _value)
494
- end
495
518
  end
496
519
 
497
520
  # Creates an instance of the object from a hash.
@@ -566,6 +589,7 @@ module AdvancedBilling
566
589
  tax_amount = hash.key?('tax_amount') ? hash['tax_amount'] : SKIP
567
590
  total_amount = hash.key?('total_amount') ? hash['total_amount'] : SKIP
568
591
  credit_amount = hash.key?('credit_amount') ? hash['credit_amount'] : SKIP
592
+ debit_amount = hash.key?('debit_amount') ? hash['debit_amount'] : SKIP
569
593
  refund_amount = hash.key?('refund_amount') ? hash['refund_amount'] : SKIP
570
594
  paid_amount = hash.key?('paid_amount') ? hash['paid_amount'] : SKIP
571
595
  due_amount = hash.key?('due_amount') ? hash['due_amount'] : SKIP
@@ -610,6 +634,16 @@ module AdvancedBilling
610
634
 
611
635
  credits = SKIP unless hash.key?('credits')
612
636
  # Parameter is an array, so we need to iterate through it
637
+ debits = nil
638
+ unless hash['debits'].nil?
639
+ debits = []
640
+ hash['debits'].each do |structure|
641
+ debits << (InvoiceDebit.from_hash(structure) if structure)
642
+ end
643
+ end
644
+
645
+ debits = SKIP unless hash.key?('debits')
646
+ # Parameter is an array, so we need to iterate through it
613
647
  refunds = nil
614
648
  unless hash['refunds'].nil?
615
649
  refunds = []
@@ -641,6 +675,8 @@ module AdvancedBilling
641
675
  custom_fields = SKIP unless hash.key?('custom_fields')
642
676
  display_settings = InvoiceDisplaySettings.from_hash(hash['display_settings']) if
643
677
  hash['display_settings']
678
+ avatax_details = InvoiceAvataxDetails.from_hash(hash['avatax_details']) if
679
+ hash['avatax_details']
644
680
  public_url = hash.key?('public_url') ? hash['public_url'] : SKIP
645
681
  previous_balance_data = InvoicePreviousBalance.from_hash(hash['previous_balance_data']) if
646
682
  hash['previous_balance_data']
@@ -648,7 +684,7 @@ module AdvancedBilling
648
684
  hash.key?('public_url_expires_on') ? hash['public_url_expires_on'] : SKIP
649
685
 
650
686
  # Clean out expected properties from Hash.
651
- names.each_value { |k| hash.delete(k) }
687
+ additional_properties = hash.reject { |k, _| names.value?(k) }
652
688
 
653
689
  # Create object from extracted values.
654
690
  Invoice.new(id: id,
@@ -690,6 +726,7 @@ module AdvancedBilling
690
726
  tax_amount: tax_amount,
691
727
  total_amount: total_amount,
692
728
  credit_amount: credit_amount,
729
+ debit_amount: debit_amount,
693
730
  refund_amount: refund_amount,
694
731
  paid_amount: paid_amount,
695
732
  due_amount: due_amount,
@@ -697,14 +734,16 @@ module AdvancedBilling
697
734
  discounts: discounts,
698
735
  taxes: taxes,
699
736
  credits: credits,
737
+ debits: debits,
700
738
  refunds: refunds,
701
739
  payments: payments,
702
740
  custom_fields: custom_fields,
703
741
  display_settings: display_settings,
742
+ avatax_details: avatax_details,
704
743
  public_url: public_url,
705
744
  previous_balance_data: previous_balance_data,
706
745
  public_url_expires_on: public_url_expires_on,
707
- additional_properties: hash)
746
+ additional_properties: additional_properties)
708
747
  end
709
748
 
710
749
  def to_custom_transaction_time
@@ -71,17 +71,17 @@ module AdvancedBilling
71
71
 
72
72
  def initialize(street: SKIP, line2: SKIP, city: SKIP, state: SKIP,
73
73
  zip: SKIP, country: SKIP, additional_properties: {})
74
+ # Add additional model properties to the instance.
75
+ additional_properties.each do |_name, _value|
76
+ instance_variable_set("@#{_name}", _value)
77
+ end
78
+
74
79
  @street = street unless street == SKIP
75
80
  @line2 = line2 unless line2 == SKIP
76
81
  @city = city unless city == SKIP
77
82
  @state = state unless state == SKIP
78
83
  @zip = zip unless zip == SKIP
79
84
  @country = country unless country == SKIP
80
-
81
- # Add additional model properties to the instance.
82
- additional_properties.each do |_name, _value|
83
- instance_variable_set("@#{_name}", _value)
84
- end
85
85
  end
86
86
 
87
87
  # Creates an instance of the object from a hash.
@@ -97,7 +97,7 @@ module AdvancedBilling
97
97
  country = hash.key?('country') ? hash['country'] : SKIP
98
98
 
99
99
  # Clean out expected properties from Hash.
100
- names.each_value { |k| hash.delete(k) }
100
+ additional_properties = hash.reject { |k, _| names.value?(k) }
101
101
 
102
102
  # Create object from extracted values.
103
103
  InvoiceAddress.new(street: street,
@@ -106,7 +106,7 @@ module AdvancedBilling
106
106
  state: state,
107
107
  zip: zip,
108
108
  country: country,
109
- additional_properties: hash)
109
+ additional_properties: additional_properties)
110
110
  end
111
111
 
112
112
  # Validates an instance of the object from a given value.
@@ -0,0 +1,130 @@
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
+ # InvoiceAvataxDetails Model.
9
+ class InvoiceAvataxDetails < 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 [String]
19
+ attr_accessor :status
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [String]
23
+ attr_accessor :document_code
24
+
25
+ # TODO: Write general description for this method
26
+ # @return [DateTime]
27
+ attr_accessor :commit_date
28
+
29
+ # TODO: Write general description for this method
30
+ # @return [DateTime]
31
+ attr_accessor :modify_date
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['status'] = 'status'
38
+ @_hash['document_code'] = 'document_code'
39
+ @_hash['commit_date'] = 'commit_date'
40
+ @_hash['modify_date'] = 'modify_date'
41
+ @_hash
42
+ end
43
+
44
+ # An array for optional fields
45
+ def self.optionals
46
+ %w[
47
+ id
48
+ status
49
+ document_code
50
+ commit_date
51
+ modify_date
52
+ ]
53
+ end
54
+
55
+ # An array for nullable fields
56
+ def self.nullables
57
+ %w[
58
+ id
59
+ status
60
+ document_code
61
+ commit_date
62
+ modify_date
63
+ ]
64
+ end
65
+
66
+ def initialize(id: SKIP, status: SKIP, document_code: SKIP,
67
+ commit_date: SKIP, modify_date: SKIP,
68
+ additional_properties: {})
69
+ # Add additional model properties to the instance.
70
+ additional_properties.each do |_name, _value|
71
+ instance_variable_set("@#{_name}", _value)
72
+ end
73
+
74
+ @id = id unless id == SKIP
75
+ @status = status unless status == SKIP
76
+ @document_code = document_code unless document_code == SKIP
77
+ @commit_date = commit_date unless commit_date == SKIP
78
+ @modify_date = modify_date unless modify_date == SKIP
79
+ end
80
+
81
+ # Creates an instance of the object from a hash.
82
+ def self.from_hash(hash)
83
+ return nil unless hash
84
+
85
+ # Extract variables from the hash.
86
+ id = hash.key?('id') ? hash['id'] : SKIP
87
+ status = hash.key?('status') ? hash['status'] : SKIP
88
+ document_code = hash.key?('document_code') ? hash['document_code'] : SKIP
89
+ commit_date = if hash.key?('commit_date')
90
+ (DateTimeHelper.from_rfc3339(hash['commit_date']) if hash['commit_date'])
91
+ else
92
+ SKIP
93
+ end
94
+ modify_date = if hash.key?('modify_date')
95
+ (DateTimeHelper.from_rfc3339(hash['modify_date']) if hash['modify_date'])
96
+ else
97
+ SKIP
98
+ end
99
+
100
+ # Clean out expected properties from Hash.
101
+ additional_properties = hash.reject { |k, _| names.value?(k) }
102
+
103
+ # Create object from extracted values.
104
+ InvoiceAvataxDetails.new(id: id,
105
+ status: status,
106
+ document_code: document_code,
107
+ commit_date: commit_date,
108
+ modify_date: modify_date,
109
+ additional_properties: additional_properties)
110
+ end
111
+
112
+ def to_custom_commit_date
113
+ DateTimeHelper.to_rfc3339(commit_date)
114
+ end
115
+
116
+ def to_custom_modify_date
117
+ DateTimeHelper.to_rfc3339(modify_date)
118
+ end
119
+
120
+ # Validates an instance of the object from a given value.
121
+ # @param [InvoiceAvataxDetails | Hash] The value against the validation is performed.
122
+ def self.validate(value)
123
+ return true if value.instance_of? self
124
+
125
+ return false unless value.instance_of? Hash
126
+
127
+ true
128
+ end
129
+ end
130
+ end
@@ -46,14 +46,14 @@ module AdvancedBilling
46
46
 
47
47
  def initialize(uid: SKIP, number: SKIP, outstanding_amount: SKIP,
48
48
  additional_properties: {})
49
- @uid = uid unless uid == SKIP
50
- @number = number unless number == SKIP
51
- @outstanding_amount = outstanding_amount unless outstanding_amount == SKIP
52
-
53
49
  # Add additional model properties to the instance.
54
50
  additional_properties.each do |_name, _value|
55
51
  instance_variable_set("@#{_name}", _value)
56
52
  end
53
+
54
+ @uid = uid unless uid == SKIP
55
+ @number = number unless number == SKIP
56
+ @outstanding_amount = outstanding_amount unless outstanding_amount == SKIP
57
57
  end
58
58
 
59
59
  # Creates an instance of the object from a hash.
@@ -67,13 +67,13 @@ module AdvancedBilling
67
67
  hash.key?('outstanding_amount') ? hash['outstanding_amount'] : SKIP
68
68
 
69
69
  # Clean out expected properties from Hash.
70
- names.each_value { |k| hash.delete(k) }
70
+ additional_properties = hash.reject { |k, _| names.value?(k) }
71
71
 
72
72
  # Create object from extracted values.
73
73
  InvoiceBalanceItem.new(uid: uid,
74
74
  number: number,
75
75
  outstanding_amount: outstanding_amount,
76
- additional_properties: hash)
76
+ additional_properties: additional_properties)
77
77
  end
78
78
 
79
79
  # Validates an instance of the object from a given value.
@@ -72,6 +72,11 @@ module AdvancedBilling
72
72
  def initialize(uid: SKIP, credit_note_number: SKIP, credit_note_uid: SKIP,
73
73
  transaction_time: SKIP, memo: SKIP, original_amount: SKIP,
74
74
  applied_amount: SKIP, additional_properties: {})
75
+ # Add additional model properties to the instance.
76
+ additional_properties.each do |_name, _value|
77
+ instance_variable_set("@#{_name}", _value)
78
+ end
79
+
75
80
  @uid = uid unless uid == SKIP
76
81
  @credit_note_number = credit_note_number unless credit_note_number == SKIP
77
82
  @credit_note_uid = credit_note_uid unless credit_note_uid == SKIP
@@ -79,11 +84,6 @@ module AdvancedBilling
79
84
  @memo = memo unless memo == SKIP
80
85
  @original_amount = original_amount unless original_amount == SKIP
81
86
  @applied_amount = applied_amount unless applied_amount == SKIP
82
-
83
- # Add additional model properties to the instance.
84
- additional_properties.each do |_name, _value|
85
- instance_variable_set("@#{_name}", _value)
86
- end
87
87
  end
88
88
 
89
89
  # Creates an instance of the object from a hash.
@@ -108,7 +108,7 @@ module AdvancedBilling
108
108
  hash.key?('applied_amount') ? hash['applied_amount'] : SKIP
109
109
 
110
110
  # Clean out expected properties from Hash.
111
- names.each_value { |k| hash.delete(k) }
111
+ additional_properties = hash.reject { |k, _| names.value?(k) }
112
112
 
113
113
  # Create object from extracted values.
114
114
  InvoiceCredit.new(uid: uid,
@@ -118,7 +118,7 @@ module AdvancedBilling
118
118
  memo: memo,
119
119
  original_amount: original_amount,
120
120
  applied_amount: applied_amount,
121
- additional_properties: hash)
121
+ additional_properties: additional_properties)
122
122
  end
123
123
 
124
124
  def to_custom_transaction_time
@@ -58,16 +58,16 @@ module AdvancedBilling
58
58
 
59
59
  def initialize(owner_id: SKIP, owner_type: SKIP, name: SKIP, value: SKIP,
60
60
  metadatum_id: SKIP, additional_properties: {})
61
+ # Add additional model properties to the instance.
62
+ additional_properties.each do |_name, _value|
63
+ instance_variable_set("@#{_name}", _value)
64
+ end
65
+
61
66
  @owner_id = owner_id unless owner_id == SKIP
62
67
  @owner_type = owner_type unless owner_type == SKIP
63
68
  @name = name unless name == SKIP
64
69
  @value = value unless value == SKIP
65
70
  @metadatum_id = metadatum_id unless metadatum_id == SKIP
66
-
67
- # Add additional model properties to the instance.
68
- additional_properties.each do |_name, _value|
69
- instance_variable_set("@#{_name}", _value)
70
- end
71
71
  end
72
72
 
73
73
  # Creates an instance of the object from a hash.
@@ -82,7 +82,7 @@ module AdvancedBilling
82
82
  metadatum_id = hash.key?('metadatum_id') ? hash['metadatum_id'] : SKIP
83
83
 
84
84
  # Clean out expected properties from Hash.
85
- names.each_value { |k| hash.delete(k) }
85
+ additional_properties = hash.reject { |k, _| names.value?(k) }
86
86
 
87
87
  # Create object from extracted values.
88
88
  InvoiceCustomField.new(owner_id: owner_id,
@@ -90,7 +90,7 @@ module AdvancedBilling
90
90
  name: name,
91
91
  value: value,
92
92
  metadatum_id: metadatum_id,
93
- additional_properties: hash)
93
+ additional_properties: additional_properties)
94
94
  end
95
95
 
96
96
  # Validates an instance of the object from a given value.
@@ -77,6 +77,11 @@ module AdvancedBilling
77
77
  def initialize(chargify_id: SKIP, first_name: SKIP, last_name: SKIP,
78
78
  organization: SKIP, email: SKIP, vat_number: SKIP,
79
79
  reference: SKIP, additional_properties: {})
80
+ # Add additional model properties to the instance.
81
+ additional_properties.each do |_name, _value|
82
+ instance_variable_set("@#{_name}", _value)
83
+ end
84
+
80
85
  @chargify_id = chargify_id unless chargify_id == SKIP
81
86
  @first_name = first_name unless first_name == SKIP
82
87
  @last_name = last_name unless last_name == SKIP
@@ -84,11 +89,6 @@ module AdvancedBilling
84
89
  @email = email unless email == SKIP
85
90
  @vat_number = vat_number unless vat_number == SKIP
86
91
  @reference = reference unless reference == SKIP
87
-
88
- # Add additional model properties to the instance.
89
- additional_properties.each do |_name, _value|
90
- instance_variable_set("@#{_name}", _value)
91
- end
92
92
  end
93
93
 
94
94
  # Creates an instance of the object from a hash.
@@ -105,7 +105,7 @@ module AdvancedBilling
105
105
  reference = hash.key?('reference') ? hash['reference'] : SKIP
106
106
 
107
107
  # Clean out expected properties from Hash.
108
- names.each_value { |k| hash.delete(k) }
108
+ additional_properties = hash.reject { |k, _| names.value?(k) }
109
109
 
110
110
  # Create object from extracted values.
111
111
  InvoiceCustomer.new(chargify_id: chargify_id,
@@ -115,7 +115,7 @@ module AdvancedBilling
115
115
  email: email,
116
116
  vat_number: vat_number,
117
117
  reference: reference,
118
- additional_properties: hash)
118
+ additional_properties: additional_properties)
119
119
  end
120
120
 
121
121
  # Validates an instance of the object from a given value.
@@ -0,0 +1,148 @@
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
+ # InvoiceDebit Model.
9
+ class InvoiceDebit < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :uid
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [String]
19
+ attr_accessor :debit_note_number
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [String]
23
+ attr_accessor :debit_note_uid
24
+
25
+ # The role of the debit note.
26
+ # @return [DebitNoteRole]
27
+ attr_accessor :role
28
+
29
+ # The role of the debit note.
30
+ # @return [DateTime]
31
+ attr_accessor :transaction_time
32
+
33
+ # The role of the debit note.
34
+ # @return [String]
35
+ attr_accessor :memo
36
+
37
+ # The role of the debit note.
38
+ # @return [String]
39
+ attr_accessor :original_amount
40
+
41
+ # The role of the debit note.
42
+ # @return [String]
43
+ attr_accessor :applied_amount
44
+
45
+ # A mapping from model property names to API property names.
46
+ def self.names
47
+ @_hash = {} if @_hash.nil?
48
+ @_hash['uid'] = 'uid'
49
+ @_hash['debit_note_number'] = 'debit_note_number'
50
+ @_hash['debit_note_uid'] = 'debit_note_uid'
51
+ @_hash['role'] = 'role'
52
+ @_hash['transaction_time'] = 'transaction_time'
53
+ @_hash['memo'] = 'memo'
54
+ @_hash['original_amount'] = 'original_amount'
55
+ @_hash['applied_amount'] = 'applied_amount'
56
+ @_hash
57
+ end
58
+
59
+ # An array for optional fields
60
+ def self.optionals
61
+ %w[
62
+ uid
63
+ debit_note_number
64
+ debit_note_uid
65
+ role
66
+ transaction_time
67
+ memo
68
+ original_amount
69
+ applied_amount
70
+ ]
71
+ end
72
+
73
+ # An array for nullable fields
74
+ def self.nullables
75
+ []
76
+ end
77
+
78
+ def initialize(uid: SKIP, debit_note_number: SKIP, debit_note_uid: SKIP,
79
+ role: SKIP, transaction_time: SKIP, memo: SKIP,
80
+ original_amount: SKIP, applied_amount: SKIP,
81
+ additional_properties: {})
82
+ # Add additional model properties to the instance.
83
+ additional_properties.each do |_name, _value|
84
+ instance_variable_set("@#{_name}", _value)
85
+ end
86
+
87
+ @uid = uid unless uid == SKIP
88
+ @debit_note_number = debit_note_number unless debit_note_number == SKIP
89
+ @debit_note_uid = debit_note_uid unless debit_note_uid == SKIP
90
+ @role = role unless role == SKIP
91
+ @transaction_time = transaction_time unless transaction_time == SKIP
92
+ @memo = memo unless memo == SKIP
93
+ @original_amount = original_amount unless original_amount == SKIP
94
+ @applied_amount = applied_amount unless applied_amount == SKIP
95
+ end
96
+
97
+ # Creates an instance of the object from a hash.
98
+ def self.from_hash(hash)
99
+ return nil unless hash
100
+
101
+ # Extract variables from the hash.
102
+ uid = hash.key?('uid') ? hash['uid'] : SKIP
103
+ debit_note_number =
104
+ hash.key?('debit_note_number') ? hash['debit_note_number'] : SKIP
105
+ debit_note_uid =
106
+ hash.key?('debit_note_uid') ? hash['debit_note_uid'] : SKIP
107
+ role = hash.key?('role') ? hash['role'] : SKIP
108
+ transaction_time = if hash.key?('transaction_time')
109
+ (DateTimeHelper.from_rfc3339(hash['transaction_time']) if hash['transaction_time'])
110
+ else
111
+ SKIP
112
+ end
113
+ memo = hash.key?('memo') ? hash['memo'] : SKIP
114
+ original_amount =
115
+ hash.key?('original_amount') ? hash['original_amount'] : SKIP
116
+ applied_amount =
117
+ hash.key?('applied_amount') ? hash['applied_amount'] : SKIP
118
+
119
+ # Clean out expected properties from Hash.
120
+ additional_properties = hash.reject { |k, _| names.value?(k) }
121
+
122
+ # Create object from extracted values.
123
+ InvoiceDebit.new(uid: uid,
124
+ debit_note_number: debit_note_number,
125
+ debit_note_uid: debit_note_uid,
126
+ role: role,
127
+ transaction_time: transaction_time,
128
+ memo: memo,
129
+ original_amount: original_amount,
130
+ applied_amount: applied_amount,
131
+ additional_properties: additional_properties)
132
+ end
133
+
134
+ def to_custom_transaction_time
135
+ DateTimeHelper.to_rfc3339(transaction_time)
136
+ end
137
+
138
+ # Validates an instance of the object from a given value.
139
+ # @param [InvoiceDebit | Hash] The value against the validation is performed.
140
+ def self.validate(value)
141
+ return true if value.instance_of? self
142
+
143
+ return false unless value.instance_of? Hash
144
+
145
+ true
146
+ end
147
+ end
148
+ end