maxio-advanced-billing-sdk 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (516) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -297
  3. data/lib/advanced_billing/client.rb +21 -22
  4. data/lib/advanced_billing/configuration.rb +17 -18
  5. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +8 -10
  6. data/lib/advanced_billing/controllers/api_exports_controller.rb +9 -9
  7. data/lib/advanced_billing/controllers/base_controller.rb +2 -1
  8. data/lib/advanced_billing/controllers/billing_portal_controller.rb +4 -4
  9. data/lib/advanced_billing/controllers/components_controller.rb +22 -22
  10. data/lib/advanced_billing/controllers/coupons_controller.rb +14 -14
  11. data/lib/advanced_billing/controllers/custom_fields_controller.rb +9 -9
  12. data/lib/advanced_billing/controllers/customers_controller.rb +7 -7
  13. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +6 -6
  14. data/lib/advanced_billing/controllers/events_controller.rb +3 -3
  15. data/lib/advanced_billing/controllers/insights_controller.rb +4 -4
  16. data/lib/advanced_billing/controllers/invoices_controller.rb +24 -20
  17. data/lib/advanced_billing/controllers/offers_controller.rb +5 -5
  18. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +12 -12
  19. data/lib/advanced_billing/controllers/product_families_controller.rb +4 -4
  20. data/lib/advanced_billing/controllers/product_price_points_controller.rb +11 -11
  21. data/lib/advanced_billing/controllers/products_controller.rb +6 -6
  22. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +44 -25
  23. data/lib/advanced_billing/controllers/reason_codes_controller.rb +5 -5
  24. data/lib/advanced_billing/controllers/referral_codes_controller.rb +2 -2
  25. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
  26. data/lib/advanced_billing/controllers/sites_controller.rb +3 -3
  27. data/lib/advanced_billing/controllers/subscription_components_controller.rb +37 -31
  28. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +4 -4
  29. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +4 -4
  30. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +23 -16
  31. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +11 -7
  32. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +5 -5
  33. data/lib/advanced_billing/controllers/subscription_products_controller.rb +2 -2
  34. data/lib/advanced_billing/controllers/subscription_status_controller.rb +10 -10
  35. data/lib/advanced_billing/controllers/subscriptions_controller.rb +12 -12
  36. data/lib/advanced_billing/controllers/webhooks_controller.rb +8 -8
  37. data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +34 -0
  38. data/lib/advanced_billing/http/auth/basic_auth.rb +27 -6
  39. data/lib/advanced_billing/models/account_balance.rb +44 -3
  40. data/lib/advanced_billing/models/account_balances.rb +24 -2
  41. data/lib/advanced_billing/models/ach_agreement.rb +12 -2
  42. data/lib/advanced_billing/models/activate_subscription_request.rb +12 -2
  43. data/lib/advanced_billing/models/add_coupons_request.rb +12 -2
  44. data/lib/advanced_billing/models/add_subscription_to_a_group.rb +12 -2
  45. data/lib/advanced_billing/models/address_change.rb +12 -2
  46. data/lib/advanced_billing/models/agreement_acceptance.rb +12 -2
  47. data/lib/advanced_billing/models/allocate_components.rb +12 -2
  48. data/lib/advanced_billing/models/allocation.rb +56 -2
  49. data/lib/advanced_billing/models/allocation_expiration_date.rb +23 -4
  50. data/lib/advanced_billing/models/allocation_preview.rb +33 -6
  51. data/lib/advanced_billing/models/allocation_preview_item.rb +12 -2
  52. data/lib/advanced_billing/models/allocation_preview_line_item.rb +12 -2
  53. data/lib/advanced_billing/models/allocation_preview_response.rb +12 -2
  54. data/lib/advanced_billing/models/allocation_response.rb +12 -2
  55. data/lib/advanced_billing/models/allocation_settings.rb +12 -2
  56. data/lib/advanced_billing/models/applied_credit_note_data.rb +12 -2
  57. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +12 -2
  58. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +12 -2
  59. data/lib/advanced_billing/models/apply_payment_event_data.rb +12 -2
  60. data/lib/advanced_billing/models/attribute_error.rb +12 -2
  61. data/lib/advanced_billing/models/auto_resume.rb +12 -2
  62. data/lib/advanced_billing/models/bank_account_attributes.rb +12 -2
  63. data/lib/advanced_billing/models/bank_account_payment_profile.rb +13 -2
  64. data/lib/advanced_billing/models/bank_account_response.rb +12 -2
  65. data/lib/advanced_billing/models/bank_account_verification.rb +12 -2
  66. data/lib/advanced_billing/models/bank_account_verification_request.rb +12 -2
  67. data/lib/advanced_billing/models/base_refund_error.rb +12 -2
  68. data/lib/advanced_billing/models/base_string_error.rb +12 -2
  69. data/lib/advanced_billing/models/batch_job.rb +33 -6
  70. data/lib/advanced_billing/models/batch_job_response.rb +12 -2
  71. data/lib/advanced_billing/models/billing_address.rb +12 -2
  72. data/lib/advanced_billing/models/billing_manifest.rb +33 -6
  73. data/lib/advanced_billing/models/billing_manifest_item.rb +12 -2
  74. data/lib/advanced_billing/models/billing_schedule.rb +12 -2
  75. data/lib/advanced_billing/models/breakouts.rb +12 -2
  76. data/lib/advanced_billing/models/{bulk_component_s_price_point_assignment.rb → bulk_components_price_point_assignment.rb} +16 -6
  77. data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +12 -2
  78. data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +12 -2
  79. data/lib/advanced_billing/models/bulk_create_segments.rb +12 -2
  80. data/lib/advanced_billing/models/bulk_update_segments.rb +12 -2
  81. data/lib/advanced_billing/models/bulk_update_segments_item.rb +12 -2
  82. data/lib/advanced_billing/models/calendar_billing.rb +12 -2
  83. data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +12 -2
  84. data/lib/advanced_billing/models/cancellation_options.rb +12 -2
  85. data/lib/advanced_billing/models/cancellation_request.rb +12 -2
  86. data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +12 -2
  87. data/lib/advanced_billing/models/chargify_ebb.rb +33 -6
  88. data/lib/advanced_billing/models/component.rb +22 -4
  89. data/lib/advanced_billing/models/component_allocation_change.rb +12 -2
  90. data/lib/advanced_billing/models/component_allocation_error_item.rb +12 -2
  91. data/lib/advanced_billing/models/component_cost_data.rb +12 -2
  92. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +12 -2
  93. data/lib/advanced_billing/models/component_currency_price.rb +12 -2
  94. data/lib/advanced_billing/models/component_currency_prices_response.rb +12 -2
  95. data/lib/advanced_billing/models/component_custom_price.rb +12 -2
  96. data/lib/advanced_billing/models/component_price.rb +12 -2
  97. data/lib/advanced_billing/models/component_price_point.rb +12 -2
  98. data/lib/advanced_billing/models/{component_s_price_point_assignment.rb → component_price_point_assignment.rb} +17 -7
  99. data/lib/advanced_billing/models/component_price_point_error_item.rb +12 -2
  100. data/lib/advanced_billing/models/component_price_point_item.rb +12 -2
  101. data/lib/advanced_billing/models/component_price_point_response.rb +12 -2
  102. data/lib/advanced_billing/models/component_price_points_response.rb +12 -2
  103. data/lib/advanced_billing/models/component_response.rb +12 -2
  104. data/lib/advanced_billing/models/consolidated_invoice.rb +12 -2
  105. data/lib/advanced_billing/models/count_response.rb +12 -2
  106. data/lib/advanced_billing/models/coupon.rb +78 -12
  107. data/lib/advanced_billing/models/coupon_currency.rb +12 -2
  108. data/lib/advanced_billing/models/coupon_currency_request.rb +12 -2
  109. data/lib/advanced_billing/models/coupon_currency_response.rb +12 -2
  110. data/lib/advanced_billing/models/coupon_response.rb +12 -2
  111. data/lib/advanced_billing/models/coupon_restriction.rb +12 -2
  112. data/lib/advanced_billing/models/coupon_subcodes.rb +12 -2
  113. data/lib/advanced_billing/models/coupon_subcodes_response.rb +12 -2
  114. data/lib/advanced_billing/models/coupon_usage.rb +12 -2
  115. data/lib/advanced_billing/models/create_allocation.rb +12 -2
  116. data/lib/advanced_billing/models/create_allocation_request.rb +12 -2
  117. data/lib/advanced_billing/models/create_component_price_point.rb +12 -2
  118. data/lib/advanced_billing/models/create_component_price_point_request.rb +12 -2
  119. data/lib/advanced_billing/models/create_component_price_points_request.rb +12 -2
  120. data/lib/advanced_billing/models/create_currency_price.rb +12 -2
  121. data/lib/advanced_billing/models/create_currency_prices_request.rb +12 -2
  122. data/lib/advanced_billing/models/create_customer.rb +12 -2
  123. data/lib/advanced_billing/models/create_customer_request.rb +12 -2
  124. data/lib/advanced_billing/models/create_ebb_component.rb +12 -2
  125. data/lib/advanced_billing/models/create_invoice.rb +12 -2
  126. data/lib/advanced_billing/models/create_invoice_address.rb +12 -2
  127. data/lib/advanced_billing/models/create_invoice_coupon.rb +12 -2
  128. data/lib/advanced_billing/models/create_invoice_item.rb +12 -2
  129. data/lib/advanced_billing/models/create_invoice_payment.rb +23 -2
  130. data/lib/advanced_billing/models/create_invoice_payment_application.rb +12 -2
  131. data/lib/advanced_billing/models/create_invoice_payment_request.rb +12 -2
  132. data/lib/advanced_billing/models/create_invoice_request.rb +12 -2
  133. data/lib/advanced_billing/models/create_metadata.rb +12 -2
  134. data/lib/advanced_billing/models/create_metadata_request.rb +12 -2
  135. data/lib/advanced_billing/models/create_metafield.rb +12 -2
  136. data/lib/advanced_billing/models/create_metafields_request.rb +12 -2
  137. data/lib/advanced_billing/models/create_metered_component.rb +12 -2
  138. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +12 -2
  139. data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +12 -2
  140. data/lib/advanced_billing/models/create_offer.rb +12 -2
  141. data/lib/advanced_billing/models/create_offer_component.rb +12 -2
  142. data/lib/advanced_billing/models/create_offer_request.rb +12 -2
  143. data/lib/advanced_billing/models/create_on_off_component.rb +12 -2
  144. data/lib/advanced_billing/models/create_or_update_coupon.rb +12 -2
  145. data/lib/advanced_billing/models/{update_endpoint.rb → create_or_update_endpoint.rb} +14 -4
  146. data/lib/advanced_billing/models/{update_endpoint_request.rb → create_or_update_endpoint_request.rb} +15 -5
  147. data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +29 -2
  148. data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +29 -2
  149. data/lib/advanced_billing/models/create_or_update_product.rb +86 -4
  150. data/lib/advanced_billing/models/create_or_update_product_request.rb +12 -2
  151. data/lib/advanced_billing/models/create_or_update_segment_price.rb +12 -2
  152. data/lib/advanced_billing/models/create_payment.rb +14 -4
  153. data/lib/advanced_billing/models/create_payment_profile.rb +12 -2
  154. data/lib/advanced_billing/models/create_payment_profile_request.rb +12 -2
  155. data/lib/advanced_billing/models/create_prepaid_component.rb +12 -2
  156. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +12 -2
  157. data/lib/advanced_billing/models/create_prepayment.rb +13 -3
  158. data/lib/advanced_billing/models/create_prepayment_method.rb +44 -0
  159. data/lib/advanced_billing/models/create_prepayment_request.rb +12 -2
  160. data/lib/advanced_billing/models/create_prepayment_response.rb +12 -2
  161. data/lib/advanced_billing/models/create_product_currency_price.rb +12 -2
  162. data/lib/advanced_billing/models/create_product_currency_prices_request.rb +12 -2
  163. data/lib/advanced_billing/models/create_product_family.rb +12 -2
  164. data/lib/advanced_billing/models/create_product_family_request.rb +12 -2
  165. data/lib/advanced_billing/models/create_product_price_point.rb +16 -6
  166. data/lib/advanced_billing/models/create_product_price_point_request.rb +12 -2
  167. data/lib/advanced_billing/models/create_quantity_based_component.rb +12 -2
  168. data/lib/advanced_billing/models/create_reason_code.rb +12 -2
  169. data/lib/advanced_billing/models/create_reason_code_request.rb +12 -2
  170. data/lib/advanced_billing/models/create_segment.rb +12 -2
  171. data/lib/advanced_billing/models/create_segment_request.rb +12 -2
  172. data/lib/advanced_billing/models/create_signup_proforma_preview_include.rb +20 -0
  173. data/lib/advanced_billing/models/create_subscription.rb +22 -4
  174. data/lib/advanced_billing/models/create_subscription_component.rb +12 -2
  175. data/lib/advanced_billing/models/create_subscription_group.rb +15 -20
  176. data/lib/advanced_billing/models/create_subscription_group_request.rb +12 -2
  177. data/lib/advanced_billing/models/create_subscription_request.rb +12 -2
  178. data/lib/advanced_billing/models/create_usage.rb +12 -2
  179. data/lib/advanced_billing/models/create_usage_request.rb +12 -2
  180. data/lib/advanced_billing/models/created_prepayment.rb +23 -4
  181. data/lib/advanced_billing/models/credit_account_balance_changed.rb +22 -5
  182. data/lib/advanced_billing/models/credit_card_attributes.rb +12 -2
  183. data/lib/advanced_billing/models/credit_card_payment_profile.rb +12 -2
  184. data/lib/advanced_billing/models/credit_note.rb +12 -2
  185. data/lib/advanced_billing/models/credit_note1.rb +12 -2
  186. data/lib/advanced_billing/models/credit_note_application.rb +23 -5
  187. data/lib/advanced_billing/models/credit_note_line_item.rb +38 -4
  188. data/lib/advanced_billing/models/credit_scheme_request.rb +12 -2
  189. data/lib/advanced_billing/models/currency_price.rb +12 -2
  190. data/lib/advanced_billing/models/currency_prices_response.rb +12 -2
  191. data/lib/advanced_billing/models/custom_field_value_change.rb +12 -2
  192. data/lib/advanced_billing/models/customer.rb +63 -15
  193. data/lib/advanced_billing/models/customer1.rb +13 -2
  194. data/lib/advanced_billing/models/customer_attributes.rb +12 -2
  195. data/lib/advanced_billing/models/customer_change.rb +12 -2
  196. data/lib/advanced_billing/models/customer_changes_preview_response.rb +12 -2
  197. data/lib/advanced_billing/models/customer_custom_fields_change.rb +12 -2
  198. data/lib/advanced_billing/models/customer_error.rb +12 -2
  199. data/lib/advanced_billing/models/customer_payer_change.rb +12 -2
  200. data/lib/advanced_billing/models/customer_response.rb +12 -2
  201. data/lib/advanced_billing/models/deduct_service_credit.rb +12 -2
  202. data/lib/advanced_billing/models/deduct_service_credit_request.rb +12 -2
  203. data/lib/advanced_billing/models/delayed_cancellation_response.rb +12 -2
  204. data/lib/advanced_billing/models/delete_subscription_group_response.rb +12 -2
  205. data/lib/advanced_billing/models/dunner_data.rb +29 -7
  206. data/lib/advanced_billing/models/dunning_step_data.rb +12 -2
  207. data/lib/advanced_billing/models/dunning_step_reached.rb +12 -2
  208. data/lib/advanced_billing/models/ebb_component.rb +12 -2
  209. data/lib/advanced_billing/models/ebb_event.rb +12 -2
  210. data/lib/advanced_billing/models/enable_webhooks_request.rb +12 -2
  211. data/lib/advanced_billing/models/enable_webhooks_response.rb +12 -2
  212. data/lib/advanced_billing/models/endpoint.rb +12 -2
  213. data/lib/advanced_billing/models/endpoint_response.rb +12 -2
  214. data/lib/advanced_billing/models/errors.rb +12 -2
  215. data/lib/advanced_billing/models/event.rb +23 -5
  216. data/lib/advanced_billing/models/event_based_billing_segment_error.rb +12 -2
  217. data/lib/advanced_billing/models/event_response.rb +12 -2
  218. data/lib/advanced_billing/models/full_subscription_group_response.rb +369 -11
  219. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +12 -2
  220. data/lib/advanced_billing/models/get_one_time_token_request.rb +12 -2
  221. data/lib/advanced_billing/models/group_billing.rb +12 -2
  222. data/lib/advanced_billing/models/group_settings.rb +12 -2
  223. data/lib/advanced_billing/models/group_target.rb +12 -2
  224. data/lib/advanced_billing/models/group_type.rb +23 -0
  225. data/lib/advanced_billing/models/invoice.rb +12 -2
  226. data/lib/advanced_billing/models/invoice_address.rb +12 -2
  227. data/lib/advanced_billing/models/invoice_balance_item.rb +12 -2
  228. data/lib/advanced_billing/models/invoice_credit.rb +12 -2
  229. data/lib/advanced_billing/models/invoice_custom_field.rb +12 -2
  230. data/lib/advanced_billing/models/invoice_customer.rb +13 -2
  231. data/lib/advanced_billing/models/invoice_discount.rb +14 -4
  232. data/lib/advanced_billing/models/invoice_discount_breakout.rb +12 -2
  233. data/lib/advanced_billing/models/invoice_discount_source_type.rb +26 -0
  234. data/lib/advanced_billing/models/invoice_discount_type.rb +26 -0
  235. data/lib/advanced_billing/models/invoice_display_settings.rb +12 -2
  236. data/lib/advanced_billing/models/invoice_event.rb +23 -4
  237. data/lib/advanced_billing/models/invoice_event_data.rb +12 -2
  238. data/lib/advanced_billing/models/invoice_event_payment.rb +12 -2
  239. data/lib/advanced_billing/models/invoice_event_payment1.rb +12 -2
  240. data/lib/advanced_billing/models/invoice_issued.rb +27 -15
  241. data/lib/advanced_billing/models/invoice_line_item.rb +22 -2
  242. data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +12 -2
  243. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +12 -2
  244. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +12 -2
  245. data/lib/advanced_billing/models/invoice_payer.rb +12 -2
  246. data/lib/advanced_billing/models/invoice_payer_change.rb +12 -2
  247. data/lib/advanced_billing/models/invoice_payment.rb +12 -2
  248. data/lib/advanced_billing/models/invoice_payment_application.rb +12 -2
  249. data/lib/advanced_billing/models/invoice_payment_method.rb +12 -2
  250. data/lib/advanced_billing/models/invoice_pre_payment.rb +25 -5
  251. data/lib/advanced_billing/models/invoice_previous_balance.rb +12 -2
  252. data/lib/advanced_billing/models/invoice_refund.rb +34 -2
  253. data/lib/advanced_billing/models/invoice_response.rb +12 -2
  254. data/lib/advanced_billing/models/invoice_seller.rb +12 -2
  255. data/lib/advanced_billing/models/invoice_tax.rb +13 -3
  256. data/lib/advanced_billing/models/invoice_tax_breakout.rb +23 -2
  257. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +12 -2
  258. data/lib/advanced_billing/models/issue_advance_invoice_request.rb +12 -2
  259. data/lib/advanced_billing/models/issue_invoice_event_data.rb +12 -2
  260. data/lib/advanced_billing/models/issue_invoice_request.rb +12 -2
  261. data/lib/advanced_billing/models/issue_service_credit.rb +12 -2
  262. data/lib/advanced_billing/models/issue_service_credit_request.rb +12 -2
  263. data/lib/advanced_billing/models/item_price_point_changed.rb +12 -2
  264. data/lib/advanced_billing/models/item_price_point_data.rb +12 -2
  265. data/lib/advanced_billing/models/list_components_price_points_response.rb +12 -2
  266. data/lib/advanced_billing/models/list_credit_notes_response.rb +12 -2
  267. data/lib/advanced_billing/models/list_invoice_events_response.rb +12 -2
  268. data/lib/advanced_billing/models/list_invoices_response.rb +12 -2
  269. data/lib/advanced_billing/models/list_metafields_response.rb +12 -2
  270. data/lib/advanced_billing/models/list_mrr_response.rb +12 -2
  271. data/lib/advanced_billing/models/list_mrr_response_result.rb +12 -2
  272. data/lib/advanced_billing/models/list_offers_response.rb +12 -2
  273. data/lib/advanced_billing/models/list_product_price_points_response.rb +12 -2
  274. data/lib/advanced_billing/models/list_proforma_invoices_meta.rb +90 -0
  275. data/lib/advanced_billing/models/list_proforma_invoices_response.rb +79 -0
  276. data/lib/advanced_billing/models/list_public_keys_meta.rb +12 -2
  277. data/lib/advanced_billing/models/list_public_keys_response.rb +12 -2
  278. data/lib/advanced_billing/models/list_sale_rep_item.rb +12 -2
  279. data/lib/advanced_billing/models/list_segments_response.rb +12 -2
  280. data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +25 -12
  281. data/lib/advanced_billing/models/list_subscription_components_response.rb +12 -2
  282. data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +12 -2
  283. data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +12 -2
  284. data/lib/advanced_billing/models/list_subscription_groups_item.rb +33 -5
  285. data/lib/advanced_billing/models/list_subscription_groups_meta.rb +12 -2
  286. data/lib/advanced_billing/models/list_subscription_groups_response.rb +12 -2
  287. data/lib/advanced_billing/models/metadata.rb +23 -4
  288. data/lib/advanced_billing/models/metafield.rb +12 -2
  289. data/lib/advanced_billing/models/metafield_scope.rb +12 -2
  290. data/lib/advanced_billing/models/metered_component.rb +12 -2
  291. data/lib/advanced_billing/models/metered_usage.rb +12 -2
  292. data/lib/advanced_billing/models/movement.rb +23 -4
  293. data/lib/advanced_billing/models/movement_line_item.rb +12 -2
  294. data/lib/advanced_billing/models/mrr.rb +23 -4
  295. data/lib/advanced_billing/models/mrr_movement.rb +12 -2
  296. data/lib/advanced_billing/models/mrr_response.rb +12 -2
  297. data/lib/advanced_billing/models/multi_invoice_payment.rb +12 -2
  298. data/lib/advanced_billing/models/multi_invoice_payment_response.rb +12 -2
  299. data/lib/advanced_billing/models/nested_subscription_group.rb +12 -2
  300. data/lib/advanced_billing/models/net_terms.rb +12 -2
  301. data/lib/advanced_billing/models/offer.rb +43 -8
  302. data/lib/advanced_billing/models/offer_discount.rb +12 -2
  303. data/lib/advanced_billing/models/offer_item.rb +12 -2
  304. data/lib/advanced_billing/models/offer_response.rb +12 -2
  305. data/lib/advanced_billing/models/offer_signup_page.rb +12 -2
  306. data/lib/advanced_billing/models/on_off_component.rb +12 -2
  307. data/lib/advanced_billing/models/organization_address.rb +12 -2
  308. data/lib/advanced_billing/models/origin_invoice.rb +12 -2
  309. data/lib/advanced_billing/models/overage_pricing.rb +12 -2
  310. data/lib/advanced_billing/models/override_subscription.rb +12 -2
  311. data/lib/advanced_billing/models/override_subscription_request.rb +12 -2
  312. data/lib/advanced_billing/models/paginated_metadata.rb +12 -2
  313. data/lib/advanced_billing/models/{payment.rb → paid_invoice.rb} +23 -13
  314. data/lib/advanced_billing/models/pause_request.rb +12 -2
  315. data/lib/advanced_billing/models/payer_attributes.rb +13 -3
  316. data/lib/advanced_billing/models/payer_error.rb +12 -2
  317. data/lib/advanced_billing/models/payment_collection_method_changed.rb +12 -2
  318. data/lib/advanced_billing/models/payment_for_allocation.rb +12 -2
  319. data/lib/advanced_billing/models/payment_method_apple_pay.rb +12 -2
  320. data/lib/advanced_billing/models/payment_method_bank_account.rb +12 -2
  321. data/lib/advanced_billing/models/payment_method_credit_card.rb +12 -2
  322. data/lib/advanced_billing/models/payment_method_external.rb +12 -2
  323. data/lib/advanced_billing/models/payment_method_paypal.rb +12 -2
  324. data/lib/advanced_billing/models/payment_profile_attributes.rb +12 -2
  325. data/lib/advanced_billing/models/payment_profile_response.rb +12 -2
  326. data/lib/advanced_billing/models/payment_related_events.rb +12 -2
  327. data/lib/advanced_billing/models/pending_cancellation_change.rb +22 -5
  328. data/lib/advanced_billing/models/portal_management_link.rb +53 -12
  329. data/lib/advanced_billing/models/prepaid_component_price_point.rb +12 -2
  330. data/lib/advanced_billing/models/prepaid_configuration.rb +12 -2
  331. data/lib/advanced_billing/models/prepaid_configuration_response.rb +12 -2
  332. data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +12 -2
  333. data/lib/advanced_billing/models/prepaid_usage.rb +12 -2
  334. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +12 -2
  335. data/lib/advanced_billing/models/prepaid_usage_component.rb +12 -2
  336. data/lib/advanced_billing/models/prepayment.rb +21 -4
  337. data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +12 -2
  338. data/lib/advanced_billing/models/prepayment_aggregated_error.rb +12 -2
  339. data/lib/advanced_billing/models/prepayment_method.rb +3 -6
  340. data/lib/advanced_billing/models/prepayment_response.rb +12 -2
  341. data/lib/advanced_billing/models/prepayments_response.rb +12 -2
  342. data/lib/advanced_billing/models/preview_allocations_request.rb +12 -2
  343. data/lib/advanced_billing/models/price.rb +12 -2
  344. data/lib/advanced_billing/models/price_point.rb +12 -2
  345. data/lib/advanced_billing/models/product.rb +14 -4
  346. data/lib/advanced_billing/models/product_family.rb +33 -6
  347. data/lib/advanced_billing/models/product_family_response.rb +12 -2
  348. data/lib/advanced_billing/models/product_price_point.rb +16 -6
  349. data/lib/advanced_billing/models/product_price_point_errors.rb +12 -2
  350. data/lib/advanced_billing/models/product_price_point_response.rb +12 -2
  351. data/lib/advanced_billing/models/product_response.rb +12 -2
  352. data/lib/advanced_billing/models/proforma_error.rb +12 -2
  353. data/lib/advanced_billing/models/proforma_invoice.rb +87 -19
  354. data/lib/advanced_billing/models/proforma_invoice_credit.rb +12 -2
  355. data/lib/advanced_billing/models/proforma_invoice_discount.rb +37 -7
  356. data/lib/advanced_billing/models/proforma_invoice_discount_source_type.rb +23 -0
  357. data/lib/advanced_billing/models/proforma_invoice_issued.rb +23 -6
  358. data/lib/advanced_billing/models/proforma_invoice_payment.rb +12 -2
  359. data/lib/advanced_billing/models/proforma_invoice_role.rb +30 -0
  360. data/lib/advanced_billing/models/proforma_invoice_status.rb +26 -0
  361. data/lib/advanced_billing/models/proforma_invoice_tax.rb +15 -5
  362. data/lib/advanced_billing/models/proforma_invoice_tax_source_type.rb +23 -0
  363. data/lib/advanced_billing/models/proration.rb +12 -2
  364. data/lib/advanced_billing/models/public_key.rb +23 -4
  365. data/lib/advanced_billing/models/public_signup_page.rb +12 -2
  366. data/lib/advanced_billing/models/quantity_based_component.rb +12 -2
  367. data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +12 -2
  368. data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +23 -5
  369. data/lib/advanced_billing/models/reactivate_subscription_request.rb +12 -2
  370. data/lib/advanced_billing/models/reactivation_billing.rb +12 -2
  371. data/lib/advanced_billing/models/reason_code.rb +33 -6
  372. data/lib/advanced_billing/models/reason_code_response.rb +12 -2
  373. data/lib/advanced_billing/models/reason_codes_json_response.rb +12 -2
  374. data/lib/advanced_billing/models/record_payment_request.rb +12 -2
  375. data/lib/advanced_billing/models/{payment_response.rb → record_payment_response.rb} +33 -9
  376. data/lib/advanced_billing/models/referral_code.rb +12 -2
  377. data/lib/advanced_billing/models/referral_validation_response.rb +12 -2
  378. data/lib/advanced_billing/models/refund.rb +12 -2
  379. data/lib/advanced_billing/models/refund_consolidated_invoice.rb +12 -2
  380. data/lib/advanced_billing/models/refund_invoice.rb +12 -2
  381. data/lib/advanced_billing/models/refund_invoice_event_data.rb +12 -2
  382. data/lib/advanced_billing/models/refund_invoice_request.rb +12 -2
  383. data/lib/advanced_billing/models/refund_prepayment.rb +12 -2
  384. data/lib/advanced_billing/models/refund_prepayment_aggregated_error.rb +12 -2
  385. data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +12 -2
  386. data/lib/advanced_billing/models/refund_prepayment_request.rb +12 -2
  387. data/lib/advanced_billing/models/refund_success.rb +12 -2
  388. data/lib/advanced_billing/models/remove_payment_event_data.rb +12 -2
  389. data/lib/advanced_billing/models/renewal_preview.rb +23 -5
  390. data/lib/advanced_billing/models/renewal_preview_component.rb +12 -2
  391. data/lib/advanced_billing/models/renewal_preview_line_item.rb +12 -2
  392. data/lib/advanced_billing/models/renewal_preview_request.rb +12 -2
  393. data/lib/advanced_billing/models/renewal_preview_response.rb +12 -2
  394. data/lib/advanced_billing/models/replay_webhooks_request.rb +12 -2
  395. data/lib/advanced_billing/models/replay_webhooks_response.rb +12 -2
  396. data/lib/advanced_billing/models/resent_invitation.rb +12 -2
  397. data/lib/advanced_billing/models/resume_options.rb +12 -2
  398. data/lib/advanced_billing/models/revoked_invitation.rb +12 -2
  399. data/lib/advanced_billing/models/sale_rep.rb +12 -2
  400. data/lib/advanced_billing/models/sale_rep_item_mrr.rb +12 -2
  401. data/lib/advanced_billing/models/sale_rep_settings.rb +12 -2
  402. data/lib/advanced_billing/models/sale_rep_subscription.rb +12 -2
  403. data/lib/advanced_billing/models/segment.rb +33 -6
  404. data/lib/advanced_billing/models/segment_price.rb +12 -2
  405. data/lib/advanced_billing/models/segment_response.rb +12 -2
  406. data/lib/advanced_billing/models/seller.rb +12 -2
  407. data/lib/advanced_billing/models/send_invoice_request.rb +12 -2
  408. data/lib/advanced_billing/models/service_credit.rb +12 -2
  409. data/lib/advanced_billing/models/service_credit_response.rb +12 -2
  410. data/lib/advanced_billing/models/shipping_address.rb +12 -2
  411. data/lib/advanced_billing/models/signup_proforma_preview.rb +12 -2
  412. data/lib/advanced_billing/models/signup_proforma_preview_response.rb +12 -2
  413. data/lib/advanced_billing/models/site.rb +12 -2
  414. data/lib/advanced_billing/models/site_response.rb +12 -2
  415. data/lib/advanced_billing/models/site_statistics.rb +16 -6
  416. data/lib/advanced_billing/models/site_summary.rb +12 -2
  417. data/lib/advanced_billing/models/subscription.rb +12 -2
  418. data/lib/advanced_billing/models/subscription_component.rb +22 -4
  419. data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +12 -2
  420. data/lib/advanced_billing/models/subscription_component_response.rb +12 -2
  421. data/lib/advanced_billing/models/subscription_component_subscription.rb +23 -4
  422. data/lib/advanced_billing/models/subscription_custom_price.rb +12 -2
  423. data/lib/advanced_billing/models/subscription_group.rb +38 -10
  424. data/lib/advanced_billing/models/subscription_group_balances.rb +12 -2
  425. data/lib/advanced_billing/models/subscription_group_bank_account.rb +12 -2
  426. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +12 -2
  427. data/lib/advanced_billing/models/subscription_group_credit_card.rb +12 -2
  428. data/lib/advanced_billing/models/subscription_group_customer.rb +12 -2
  429. data/lib/advanced_billing/models/subscription_group_include.rb +20 -0
  430. data/lib/advanced_billing/models/subscription_group_item.rb +12 -2
  431. data/lib/advanced_billing/models/subscription_group_member_error.rb +12 -2
  432. data/lib/advanced_billing/models/subscription_group_members_array_error.rb +72 -0
  433. data/lib/advanced_billing/models/subscription_group_payment_profile.rb +12 -2
  434. data/lib/advanced_billing/models/subscription_group_prepayment.rb +12 -2
  435. data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +12 -2
  436. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +12 -2
  437. data/lib/advanced_billing/models/subscription_group_response.rb +12 -2
  438. data/lib/advanced_billing/models/subscription_group_signup.rb +12 -2
  439. data/lib/advanced_billing/models/subscription_group_signup_component.rb +12 -2
  440. data/lib/advanced_billing/models/subscription_group_signup_error.rb +12 -2
  441. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +12 -2
  442. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +12 -2
  443. data/lib/advanced_billing/models/subscription_group_signup_item.rb +12 -2
  444. data/lib/advanced_billing/models/subscription_group_signup_request.rb +12 -2
  445. data/lib/advanced_billing/models/subscription_group_signup_response.rb +231 -9
  446. data/lib/advanced_billing/models/subscription_group_signup_success.rb +12 -2
  447. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +21 -5
  448. data/lib/advanced_billing/models/subscription_group_single_error.rb +73 -0
  449. data/lib/advanced_billing/models/subscription_group_subscription_error.rb +66 -2
  450. data/lib/advanced_billing/models/subscription_group_update_error.rb +12 -2
  451. data/lib/advanced_billing/models/subscription_groups_list_include.rb +20 -0
  452. data/lib/advanced_billing/models/subscription_included_coupon.rb +12 -2
  453. data/lib/advanced_billing/models/subscription_migration_preview.rb +12 -2
  454. data/lib/advanced_billing/models/subscription_migration_preview_options.rb +23 -5
  455. data/lib/advanced_billing/models/subscription_migration_preview_request.rb +12 -2
  456. data/lib/advanced_billing/models/subscription_migration_preview_response.rb +12 -2
  457. data/lib/advanced_billing/models/subscription_mrr.rb +12 -2
  458. data/lib/advanced_billing/models/subscription_mrr_breakout.rb +12 -2
  459. data/lib/advanced_billing/models/subscription_mrr_response.rb +12 -2
  460. data/lib/advanced_billing/models/subscription_note.rb +33 -6
  461. data/lib/advanced_billing/models/subscription_note_response.rb +12 -2
  462. data/lib/advanced_billing/models/subscription_preview.rb +12 -2
  463. data/lib/advanced_billing/models/subscription_preview_response.rb +12 -2
  464. data/lib/advanced_billing/models/subscription_product_change.rb +12 -2
  465. data/lib/advanced_billing/models/subscription_product_migration.rb +12 -2
  466. data/lib/advanced_billing/models/subscription_product_migration_request.rb +12 -2
  467. data/lib/advanced_billing/models/subscription_response.rb +12 -2
  468. data/lib/advanced_billing/models/subscription_state_change.rb +12 -2
  469. data/lib/advanced_billing/models/tax_configuration.rb +12 -2
  470. data/lib/advanced_billing/models/too_many_management_link_requests.rb +12 -2
  471. data/lib/advanced_billing/models/update_allocation_expiration_date.rb +12 -2
  472. data/lib/advanced_billing/models/update_component.rb +12 -2
  473. data/lib/advanced_billing/models/update_component_price_point.rb +12 -2
  474. data/lib/advanced_billing/models/update_component_price_point_request.rb +12 -2
  475. data/lib/advanced_billing/models/update_component_request.rb +12 -2
  476. data/lib/advanced_billing/models/update_coupon_currency.rb +12 -2
  477. data/lib/advanced_billing/models/update_currency_price.rb +12 -2
  478. data/lib/advanced_billing/models/update_currency_prices_request.rb +12 -2
  479. data/lib/advanced_billing/models/update_customer.rb +12 -2
  480. data/lib/advanced_billing/models/update_customer_request.rb +12 -2
  481. data/lib/advanced_billing/models/update_metadata.rb +12 -2
  482. data/lib/advanced_billing/models/update_metadata_request.rb +12 -2
  483. data/lib/advanced_billing/models/update_metafield.rb +12 -2
  484. data/lib/advanced_billing/models/update_metafields_request.rb +12 -2
  485. data/lib/advanced_billing/models/update_payment_profile.rb +12 -2
  486. data/lib/advanced_billing/models/update_payment_profile_request.rb +12 -2
  487. data/lib/advanced_billing/models/update_price.rb +12 -2
  488. data/lib/advanced_billing/models/update_product_price_point.rb +12 -2
  489. data/lib/advanced_billing/models/update_product_price_point_request.rb +12 -2
  490. data/lib/advanced_billing/models/update_reason_code.rb +12 -2
  491. data/lib/advanced_billing/models/update_reason_code_request.rb +12 -2
  492. data/lib/advanced_billing/models/update_segment.rb +12 -2
  493. data/lib/advanced_billing/models/update_segment_request.rb +12 -2
  494. data/lib/advanced_billing/models/update_subscription.rb +23 -5
  495. data/lib/advanced_billing/models/update_subscription_component.rb +12 -2
  496. data/lib/advanced_billing/models/update_subscription_group.rb +12 -2
  497. data/lib/advanced_billing/models/update_subscription_group_request.rb +12 -2
  498. data/lib/advanced_billing/models/update_subscription_note.rb +12 -2
  499. data/lib/advanced_billing/models/update_subscription_note_request.rb +12 -2
  500. data/lib/advanced_billing/models/update_subscription_request.rb +12 -2
  501. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +12 -2
  502. data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +12 -2
  503. data/lib/advanced_billing/models/usage.rb +12 -2
  504. data/lib/advanced_billing/models/usage_response.rb +12 -2
  505. data/lib/advanced_billing/models/void_invoice.rb +12 -2
  506. data/lib/advanced_billing/models/void_invoice_event_data.rb +12 -2
  507. data/lib/advanced_billing/models/void_invoice_request.rb +12 -2
  508. data/lib/advanced_billing/models/void_remainder_event_data.rb +12 -2
  509. data/lib/advanced_billing/models/webhook.rb +53 -10
  510. data/lib/advanced_billing/models/webhook_response.rb +12 -2
  511. data/lib/advanced_billing/utilities/union_type_lookup.rb +20 -8
  512. data/lib/advanced_billing.rb +25 -12
  513. metadata +24 -11
  514. data/lib/advanced_billing/models/proforma_invoice_discount_breakout.rb +0 -62
  515. data/lib/advanced_billing/models/proforma_invoice_preview.rb +0 -484
  516. data/lib/advanced_billing/models/proforma_invoice_tax_breakout.rb +0 -61
@@ -3,6 +3,7 @@
3
3
  # This file was automatically generated by APIMATIC v2.0
4
4
  # ( https://apimatic.io ).
5
5
 
6
+ require 'date'
6
7
  module AdvancedBilling
7
8
  # ProductFamily Model.
8
9
  class ProductFamily < BaseModel
@@ -30,11 +31,11 @@ module AdvancedBilling
30
31
  attr_accessor :description
31
32
 
32
33
  # TODO: Write general description for this method
33
- # @return [String]
34
+ # @return [DateTime]
34
35
  attr_accessor :created_at
35
36
 
36
37
  # TODO: Write general description for this method
37
- # @return [String]
38
+ # @return [DateTime]
38
39
  attr_accessor :updated_at
39
40
 
40
41
  # A mapping from model property names to API property names.
@@ -77,7 +78,8 @@ module AdvancedBilling
77
78
  accounting_code = SKIP,
78
79
  description = SKIP,
79
80
  created_at = SKIP,
80
- updated_at = SKIP)
81
+ updated_at = SKIP,
82
+ additional_properties = {})
81
83
  @id = id unless id == SKIP
82
84
  @name = name unless name == SKIP
83
85
  @handle = handle unless handle == SKIP
@@ -85,6 +87,11 @@ module AdvancedBilling
85
87
  @description = description unless description == SKIP
86
88
  @created_at = created_at unless created_at == SKIP
87
89
  @updated_at = updated_at unless updated_at == SKIP
90
+
91
+ # Add additional model properties to the instance.
92
+ additional_properties.each do |_name, _value|
93
+ instance_variable_set("@#{_name}", _value)
94
+ end
88
95
  end
89
96
 
90
97
  # Creates an instance of the object from a hash.
@@ -98,8 +105,19 @@ module AdvancedBilling
98
105
  accounting_code =
99
106
  hash.key?('accounting_code') ? hash['accounting_code'] : SKIP
100
107
  description = hash.key?('description') ? hash['description'] : SKIP
101
- created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
102
- updated_at = hash.key?('updated_at') ? hash['updated_at'] : SKIP
108
+ created_at = if hash.key?('created_at')
109
+ (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
110
+ else
111
+ SKIP
112
+ end
113
+ updated_at = if hash.key?('updated_at')
114
+ (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
115
+ else
116
+ SKIP
117
+ end
118
+
119
+ # Clean out expected properties from Hash.
120
+ names.each_value { |k| hash.delete(k) }
103
121
 
104
122
  # Create object from extracted values.
105
123
  ProductFamily.new(id,
@@ -108,7 +126,16 @@ module AdvancedBilling
108
126
  accounting_code,
109
127
  description,
110
128
  created_at,
111
- updated_at)
129
+ updated_at,
130
+ hash)
131
+ end
132
+
133
+ def to_custom_created_at
134
+ DateTimeHelper.to_rfc3339(created_at)
135
+ end
136
+
137
+ def to_custom_updated_at
138
+ DateTimeHelper.to_rfc3339(updated_at)
112
139
  end
113
140
  end
114
141
  end
@@ -32,8 +32,14 @@ module AdvancedBilling
32
32
  []
33
33
  end
34
34
 
35
- def initialize(product_family = SKIP)
35
+ def initialize(product_family = SKIP,
36
+ additional_properties = {})
36
37
  @product_family = product_family unless product_family == SKIP
38
+
39
+ # Add additional model properties to the instance.
40
+ additional_properties.each do |_name, _value|
41
+ instance_variable_set("@#{_name}", _value)
42
+ end
37
43
  end
38
44
 
39
45
  # Creates an instance of the object from a hash.
@@ -43,8 +49,12 @@ module AdvancedBilling
43
49
  # Extract variables from the hash.
44
50
  product_family = ProductFamily.from_hash(hash['product_family']) if hash['product_family']
45
51
 
52
+ # Clean out expected properties from Hash.
53
+ names.each_value { |k| hash.delete(k) }
54
+
46
55
  # Create object from extracted values.
47
- ProductFamilyResponse.new(product_family)
56
+ ProductFamilyResponse.new(product_family,
57
+ hash)
48
58
  end
49
59
  end
50
60
  end
@@ -41,9 +41,9 @@ module AdvancedBilling
41
41
  # @return [Integer]
42
42
  attr_accessor :trial_price_in_cents
43
43
 
44
- # The numerical trial interval. i.e. an interval of ‘30’ coupled with an
45
- # trial_interval_unit of day would mean this product price point would renew
46
- # every 30 days
44
+ # The numerical trial interval. i.e. an interval of ‘30’ coupled with a
45
+ # trial_interval_unit of day would mean this product price point trial would
46
+ # last 30 days
47
47
  # @return [Integer]
48
48
  attr_accessor :trial_interval
49
49
 
@@ -71,7 +71,7 @@ module AdvancedBilling
71
71
 
72
72
  # The numerical expiration interval. i.e. an expiration_interval of ‘30’
73
73
  # coupled with an expiration_interval_unit of day would mean this product
74
- # price point would expire every 30 days
74
+ # price point would expire after 30 days
75
75
  # @return [Integer]
76
76
  attr_accessor :expiration_interval
77
77
 
@@ -212,7 +212,8 @@ module AdvancedBilling
212
212
  type = SKIP,
213
213
  tax_included = SKIP,
214
214
  subscription_id = SKIP,
215
- currency_prices = SKIP)
215
+ currency_prices = SKIP,
216
+ additional_properties = {})
216
217
  @id = id unless id == SKIP
217
218
  @name = name unless name == SKIP
218
219
  @handle = handle unless handle == SKIP
@@ -240,6 +241,11 @@ module AdvancedBilling
240
241
  @tax_included = tax_included unless tax_included == SKIP
241
242
  @subscription_id = subscription_id unless subscription_id == SKIP
242
243
  @currency_prices = currency_prices unless currency_prices == SKIP
244
+
245
+ # Add additional model properties to the instance.
246
+ additional_properties.each do |_name, _value|
247
+ instance_variable_set("@#{_name}", _value)
248
+ end
243
249
  end
244
250
 
245
251
  # Creates an instance of the object from a hash.
@@ -304,6 +310,9 @@ module AdvancedBilling
304
310
 
305
311
  currency_prices = SKIP unless hash.key?('currency_prices')
306
312
 
313
+ # Clean out expected properties from Hash.
314
+ names.each_value { |k| hash.delete(k) }
315
+
307
316
  # Create object from extracted values.
308
317
  ProductPricePoint.new(id,
309
318
  name,
@@ -328,7 +337,8 @@ module AdvancedBilling
328
337
  type,
329
338
  tax_included,
330
339
  subscription_id,
331
- currency_prices)
340
+ currency_prices,
341
+ hash)
332
342
  end
333
343
 
334
344
  def to_custom_archived_at
@@ -67,13 +67,19 @@ module AdvancedBilling
67
67
  interval_unit = SKIP,
68
68
  name = SKIP,
69
69
  price = SKIP,
70
- price_in_cents = SKIP)
70
+ price_in_cents = SKIP,
71
+ additional_properties = {})
71
72
  @price_point = price_point unless price_point == SKIP
72
73
  @interval = interval unless interval == SKIP
73
74
  @interval_unit = interval_unit unless interval_unit == SKIP
74
75
  @name = name unless name == SKIP
75
76
  @price = price unless price == SKIP
76
77
  @price_in_cents = price_in_cents unless price_in_cents == SKIP
78
+
79
+ # Add additional model properties to the instance.
80
+ additional_properties.each do |_name, _value|
81
+ instance_variable_set("@#{_name}", _value)
82
+ end
77
83
  end
78
84
 
79
85
  # Creates an instance of the object from a hash.
@@ -89,13 +95,17 @@ module AdvancedBilling
89
95
  price_in_cents =
90
96
  hash.key?('price_in_cents') ? hash['price_in_cents'] : SKIP
91
97
 
98
+ # Clean out expected properties from Hash.
99
+ names.each_value { |k| hash.delete(k) }
100
+
92
101
  # Create object from extracted values.
93
102
  ProductPricePointErrors.new(price_point,
94
103
  interval,
95
104
  interval_unit,
96
105
  name,
97
106
  price,
98
- price_in_cents)
107
+ price_in_cents,
108
+ hash)
99
109
  end
100
110
  end
101
111
  end
@@ -30,8 +30,14 @@ module AdvancedBilling
30
30
  []
31
31
  end
32
32
 
33
- def initialize(price_point = nil)
33
+ def initialize(price_point = nil,
34
+ additional_properties = {})
34
35
  @price_point = price_point
36
+
37
+ # Add additional model properties to the instance.
38
+ additional_properties.each do |_name, _value|
39
+ instance_variable_set("@#{_name}", _value)
40
+ end
35
41
  end
36
42
 
37
43
  # Creates an instance of the object from a hash.
@@ -41,8 +47,12 @@ module AdvancedBilling
41
47
  # Extract variables from the hash.
42
48
  price_point = ProductPricePoint.from_hash(hash['price_point']) if hash['price_point']
43
49
 
50
+ # Clean out expected properties from Hash.
51
+ names.each_value { |k| hash.delete(k) }
52
+
44
53
  # Create object from extracted values.
45
- ProductPricePointResponse.new(price_point)
54
+ ProductPricePointResponse.new(price_point,
55
+ hash)
46
56
  end
47
57
  end
48
58
  end
@@ -30,8 +30,14 @@ module AdvancedBilling
30
30
  []
31
31
  end
32
32
 
33
- def initialize(product = nil)
33
+ def initialize(product = nil,
34
+ additional_properties = {})
34
35
  @product = product
36
+
37
+ # Add additional model properties to the instance.
38
+ additional_properties.each do |_name, _value|
39
+ instance_variable_set("@#{_name}", _value)
40
+ end
35
41
  end
36
42
 
37
43
  # Creates an instance of the object from a hash.
@@ -41,8 +47,12 @@ module AdvancedBilling
41
47
  # Extract variables from the hash.
42
48
  product = Product.from_hash(hash['product']) if hash['product']
43
49
 
50
+ # Clean out expected properties from Hash.
51
+ names.each_value { |k| hash.delete(k) }
52
+
44
53
  # Create object from extracted values.
45
- ProductResponse.new(product)
54
+ ProductResponse.new(product,
55
+ hash)
46
56
  end
47
57
  end
48
58
  end
@@ -33,8 +33,14 @@ module AdvancedBilling
33
33
  []
34
34
  end
35
35
 
36
- def initialize(subscription = SKIP)
36
+ def initialize(subscription = SKIP,
37
+ additional_properties = {})
37
38
  @subscription = subscription unless subscription == SKIP
39
+
40
+ # Add additional model properties to the instance.
41
+ additional_properties.each do |_name, _value|
42
+ instance_variable_set("@#{_name}", _value)
43
+ end
38
44
  end
39
45
 
40
46
  # Creates an instance of the object from a hash.
@@ -44,8 +50,12 @@ module AdvancedBilling
44
50
  # Extract variables from the hash.
45
51
  subscription = BaseStringError.from_hash(hash['subscription']) if hash['subscription']
46
52
 
53
+ # Clean out expected properties from Hash.
54
+ names.each_value { |k| hash.delete(k) }
55
+
47
56
  # Create object from extracted values.
48
- ProformaError.new(subscription)
57
+ ProformaError.new(subscription,
58
+ hash)
49
59
  end
50
60
  end
51
61
  end
@@ -3,6 +3,7 @@
3
3
  # This file was automatically generated by APIMATIC v2.0
4
4
  # ( https://apimatic.io ).
5
5
 
6
+ require 'date'
6
7
  module AdvancedBilling
7
8
  # ProformaInvoice Model.
8
9
  class ProformaInvoice < BaseModel
@@ -34,43 +35,86 @@ module AdvancedBilling
34
35
  attr_accessor :sequence_number
35
36
 
36
37
  # TODO: Write general description for this method
37
- # @return [String]
38
+ # @return [DateTime]
38
39
  attr_accessor :created_at
39
40
 
40
41
  # TODO: Write general description for this method
41
- # @return [String]
42
+ # @return [Date]
42
43
  attr_accessor :delivery_date
43
44
 
44
45
  # TODO: Write general description for this method
45
- # @return [String]
46
+ # @return [ProformaInvoiceStatus]
46
47
  attr_accessor :status
47
48
 
48
- # TODO: Write general description for this method
49
- # @return [String]
49
+ # The type of payment collection to be used in the subscription. For legacy
50
+ # Statements Architecture valid options are - `invoice`, `automatic`. For
51
+ # current Relationship Invoicing Architecture valid options are -
52
+ # `remittance`, `automatic`, `prepaid`.
53
+ # @return [CollectionMethod]
50
54
  attr_accessor :collection_method
51
55
 
52
- # TODO: Write general description for this method
56
+ # The type of payment collection to be used in the subscription. For legacy
57
+ # Statements Architecture valid options are - `invoice`, `automatic`. For
58
+ # current Relationship Invoicing Architecture valid options are -
59
+ # `remittance`, `automatic`, `prepaid`.
53
60
  # @return [String]
54
61
  attr_accessor :payment_instructions
55
62
 
56
- # TODO: Write general description for this method
63
+ # The type of payment collection to be used in the subscription. For legacy
64
+ # Statements Architecture valid options are - `invoice`, `automatic`. For
65
+ # current Relationship Invoicing Architecture valid options are -
66
+ # `remittance`, `automatic`, `prepaid`.
57
67
  # @return [String]
58
68
  attr_accessor :currency
59
69
 
60
- # TODO: Write general description for this method
61
- # @return [String]
70
+ # Consolidation level of the invoice, which is applicable to invoice
71
+ # consolidation. It will hold one of the following values:
72
+ # * "none": A normal invoice with no consolidation.
73
+ # * "child": An invoice segment which has been combined into a consolidated
74
+ # invoice.
75
+ # * "parent": A consolidated invoice, whose contents are composed of invoice
76
+ # segments.
77
+ # "Parent" invoices do not have lines of their own, but they have subtotals
78
+ # and totals which aggregate the member invoice segments.
79
+ # See also the [invoice consolidation
80
+ # documentation](https://chargify.zendesk.com/hc/en-us/articles/440774639183
81
+ # 5).
82
+ # @return [InvoiceConsolidationLevel]
62
83
  attr_accessor :consolidation_level
63
84
 
64
- # TODO: Write general description for this method
85
+ # Consolidation level of the invoice, which is applicable to invoice
86
+ # consolidation. It will hold one of the following values:
87
+ # * "none": A normal invoice with no consolidation.
88
+ # * "child": An invoice segment which has been combined into a consolidated
89
+ # invoice.
90
+ # * "parent": A consolidated invoice, whose contents are composed of invoice
91
+ # segments.
92
+ # "Parent" invoices do not have lines of their own, but they have subtotals
93
+ # and totals which aggregate the member invoice segments.
94
+ # See also the [invoice consolidation
95
+ # documentation](https://chargify.zendesk.com/hc/en-us/articles/440774639183
96
+ # 5).
65
97
  # @return [String]
66
98
  attr_accessor :product_name
67
99
 
68
- # TODO: Write general description for this method
100
+ # Consolidation level of the invoice, which is applicable to invoice
101
+ # consolidation. It will hold one of the following values:
102
+ # * "none": A normal invoice with no consolidation.
103
+ # * "child": An invoice segment which has been combined into a consolidated
104
+ # invoice.
105
+ # * "parent": A consolidated invoice, whose contents are composed of invoice
106
+ # segments.
107
+ # "Parent" invoices do not have lines of their own, but they have subtotals
108
+ # and totals which aggregate the member invoice segments.
109
+ # See also the [invoice consolidation
110
+ # documentation](https://chargify.zendesk.com/hc/en-us/articles/440774639183
111
+ # 5).
69
112
  # @return [String]
70
113
  attr_accessor :product_family_name
71
114
 
72
- # TODO: Write general description for this method
73
- # @return [String]
115
+ # 'proforma' value is deprecated in favor of proforma_adhoc and
116
+ # proforma_automatic
117
+ # @return [ProformaInvoiceRole]
74
118
  attr_accessor :role
75
119
 
76
120
  # Information about the seller (merchant) listed on the masthead of the
@@ -259,7 +303,13 @@ module AdvancedBilling
259
303
 
260
304
  # An array for nullable fields
261
305
  def self.nullables
262
- []
306
+ %w[
307
+ customer_id
308
+ subscription_id
309
+ number
310
+ sequence_number
311
+ public_url
312
+ ]
263
313
  end
264
314
 
265
315
  def initialize(uid = SKIP,
@@ -271,7 +321,7 @@ module AdvancedBilling
271
321
  created_at = SKIP,
272
322
  delivery_date = SKIP,
273
323
  status = SKIP,
274
- collection_method = SKIP,
324
+ collection_method = CollectionMethod::AUTOMATIC,
275
325
  payment_instructions = SKIP,
276
326
  currency = SKIP,
277
327
  consolidation_level = SKIP,
@@ -297,7 +347,8 @@ module AdvancedBilling
297
347
  credits = SKIP,
298
348
  payments = SKIP,
299
349
  custom_fields = SKIP,
300
- public_url = SKIP)
350
+ public_url = SKIP,
351
+ additional_properties = {})
301
352
  @uid = uid unless uid == SKIP
302
353
  @site_id = site_id unless site_id == SKIP
303
354
  @customer_id = customer_id unless customer_id == SKIP
@@ -334,6 +385,11 @@ module AdvancedBilling
334
385
  @payments = payments unless payments == SKIP
335
386
  @custom_fields = custom_fields unless custom_fields == SKIP
336
387
  @public_url = public_url unless public_url == SKIP
388
+
389
+ # Add additional model properties to the instance.
390
+ additional_properties.each do |_name, _value|
391
+ instance_variable_set("@#{_name}", _value)
392
+ end
337
393
  end
338
394
 
339
395
  # Creates an instance of the object from a hash.
@@ -349,11 +405,15 @@ module AdvancedBilling
349
405
  number = hash.key?('number') ? hash['number'] : SKIP
350
406
  sequence_number =
351
407
  hash.key?('sequence_number') ? hash['sequence_number'] : SKIP
352
- created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
408
+ created_at = if hash.key?('created_at')
409
+ (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
410
+ else
411
+ SKIP
412
+ end
353
413
  delivery_date = hash.key?('delivery_date') ? hash['delivery_date'] : SKIP
354
414
  status = hash.key?('status') ? hash['status'] : SKIP
355
415
  collection_method =
356
- hash.key?('collection_method') ? hash['collection_method'] : SKIP
416
+ hash['collection_method'] ||= CollectionMethod::AUTOMATIC
357
417
  payment_instructions =
358
418
  hash.key?('payment_instructions') ? hash['payment_instructions'] : SKIP
359
419
  currency = hash.key?('currency') ? hash['currency'] : SKIP
@@ -442,6 +502,9 @@ module AdvancedBilling
442
502
  custom_fields = SKIP unless hash.key?('custom_fields')
443
503
  public_url = hash.key?('public_url') ? hash['public_url'] : SKIP
444
504
 
505
+ # Clean out expected properties from Hash.
506
+ names.each_value { |k| hash.delete(k) }
507
+
445
508
  # Create object from extracted values.
446
509
  ProformaInvoice.new(uid,
447
510
  site_id,
@@ -478,7 +541,12 @@ module AdvancedBilling
478
541
  credits,
479
542
  payments,
480
543
  custom_fields,
481
- public_url)
544
+ public_url,
545
+ hash)
546
+ end
547
+
548
+ def to_custom_created_at
549
+ DateTimeHelper.to_rfc3339(created_at)
482
550
  end
483
551
  end
484
552
  end
@@ -53,11 +53,17 @@ module AdvancedBilling
53
53
  def initialize(uid = SKIP,
54
54
  memo = SKIP,
55
55
  original_amount = SKIP,
56
- applied_amount = SKIP)
56
+ applied_amount = SKIP,
57
+ additional_properties = {})
57
58
  @uid = uid unless uid == SKIP
58
59
  @memo = memo unless memo == SKIP
59
60
  @original_amount = original_amount unless original_amount == SKIP
60
61
  @applied_amount = applied_amount unless applied_amount == SKIP
62
+
63
+ # Add additional model properties to the instance.
64
+ additional_properties.each do |_name, _value|
65
+ instance_variable_set("@#{_name}", _value)
66
+ end
61
67
  end
62
68
 
63
69
  # Creates an instance of the object from a hash.
@@ -72,11 +78,15 @@ module AdvancedBilling
72
78
  applied_amount =
73
79
  hash.key?('applied_amount') ? hash['applied_amount'] : SKIP
74
80
 
81
+ # Clean out expected properties from Hash.
82
+ names.each_value { |k| hash.delete(k) }
83
+
75
84
  # Create object from extracted values.
76
85
  ProformaInvoiceCredit.new(uid,
77
86
  memo,
78
87
  original_amount,
79
- applied_amount)
88
+ applied_amount,
89
+ hash)
80
90
  end
81
91
  end
82
92
  end
@@ -9,16 +9,24 @@ module AdvancedBilling
9
9
  SKIP = Object.new
10
10
  private_constant :SKIP
11
11
 
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :uid
15
+
12
16
  # TODO: Write general description for this method
13
17
  # @return [String]
14
18
  attr_accessor :title
15
19
 
16
20
  # TODO: Write general description for this method
17
21
  # @return [String]
22
+ attr_accessor :code
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [ProformaInvoiceDiscountSourceType]
18
26
  attr_accessor :source_type
19
27
 
20
28
  # TODO: Write general description for this method
21
- # @return [String]
29
+ # @return [InvoiceDiscountType]
22
30
  attr_accessor :discount_type
23
31
 
24
32
  # TODO: Write general description for this method
@@ -30,13 +38,15 @@ module AdvancedBilling
30
38
  attr_accessor :discount_amount
31
39
 
32
40
  # TODO: Write general description for this method
33
- # @return [Array[ProformaInvoiceDiscountBreakout]]
41
+ # @return [Array[InvoiceDiscountBreakout]]
34
42
  attr_accessor :line_item_breakouts
35
43
 
36
44
  # A mapping from model property names to API property names.
37
45
  def self.names
38
46
  @_hash = {} if @_hash.nil?
47
+ @_hash['uid'] = 'uid'
39
48
  @_hash['title'] = 'title'
49
+ @_hash['code'] = 'code'
40
50
  @_hash['source_type'] = 'source_type'
41
51
  @_hash['discount_type'] = 'discount_type'
42
52
  @_hash['eligible_amount'] = 'eligible_amount'
@@ -48,7 +58,9 @@ module AdvancedBilling
48
58
  # An array for optional fields
49
59
  def self.optionals
50
60
  %w[
61
+ uid
51
62
  title
63
+ code
52
64
  source_type
53
65
  discount_type
54
66
  eligible_amount
@@ -62,18 +74,28 @@ module AdvancedBilling
62
74
  []
63
75
  end
64
76
 
65
- def initialize(title = SKIP,
77
+ def initialize(uid = SKIP,
78
+ title = SKIP,
79
+ code = SKIP,
66
80
  source_type = SKIP,
67
81
  discount_type = SKIP,
68
82
  eligible_amount = SKIP,
69
83
  discount_amount = SKIP,
70
- line_item_breakouts = SKIP)
84
+ line_item_breakouts = SKIP,
85
+ additional_properties = {})
86
+ @uid = uid unless uid == SKIP
71
87
  @title = title unless title == SKIP
88
+ @code = code unless code == SKIP
72
89
  @source_type = source_type unless source_type == SKIP
73
90
  @discount_type = discount_type unless discount_type == SKIP
74
91
  @eligible_amount = eligible_amount unless eligible_amount == SKIP
75
92
  @discount_amount = discount_amount unless discount_amount == SKIP
76
93
  @line_item_breakouts = line_item_breakouts unless line_item_breakouts == SKIP
94
+
95
+ # Add additional model properties to the instance.
96
+ additional_properties.each do |_name, _value|
97
+ instance_variable_set("@#{_name}", _value)
98
+ end
77
99
  end
78
100
 
79
101
  # Creates an instance of the object from a hash.
@@ -81,7 +103,9 @@ module AdvancedBilling
81
103
  return nil unless hash
82
104
 
83
105
  # Extract variables from the hash.
106
+ uid = hash.key?('uid') ? hash['uid'] : SKIP
84
107
  title = hash.key?('title') ? hash['title'] : SKIP
108
+ code = hash.key?('code') ? hash['code'] : SKIP
85
109
  source_type = hash.key?('source_type') ? hash['source_type'] : SKIP
86
110
  discount_type = hash.key?('discount_type') ? hash['discount_type'] : SKIP
87
111
  eligible_amount =
@@ -93,19 +117,25 @@ module AdvancedBilling
93
117
  unless hash['line_item_breakouts'].nil?
94
118
  line_item_breakouts = []
95
119
  hash['line_item_breakouts'].each do |structure|
96
- line_item_breakouts << (ProformaInvoiceDiscountBreakout.from_hash(structure) if structure)
120
+ line_item_breakouts << (InvoiceDiscountBreakout.from_hash(structure) if structure)
97
121
  end
98
122
  end
99
123
 
100
124
  line_item_breakouts = SKIP unless hash.key?('line_item_breakouts')
101
125
 
126
+ # Clean out expected properties from Hash.
127
+ names.each_value { |k| hash.delete(k) }
128
+
102
129
  # Create object from extracted values.
103
- ProformaInvoiceDiscount.new(title,
130
+ ProformaInvoiceDiscount.new(uid,
131
+ title,
132
+ code,
104
133
  source_type,
105
134
  discount_type,
106
135
  eligible_amount,
107
136
  discount_amount,
108
- line_item_breakouts)
137
+ line_item_breakouts,
138
+ hash)
109
139
  end
110
140
  end
111
141
  end
@@ -0,0 +1,23 @@
1
+ # advanced_billing
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module AdvancedBilling
7
+ # Proforma Invoice Discount Source Type.
8
+ class ProformaInvoiceDiscountSourceType
9
+ PROFORMA_INVOICE_DISCOUNT_SOURCE_TYPE = [
10
+ # TODO: Write general description for COUPON
11
+ COUPON = 'Coupon'.freeze,
12
+
13
+ # TODO: Write general description for REFERRAL
14
+ REFERRAL = 'Referral'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ PROFORMA_INVOICE_DISCOUNT_SOURCE_TYPE.include?(value)
21
+ end
22
+ end
23
+ end