maxio-advanced-billing-sdk 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (710) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +28 -0
  3. data/README.md +374 -0
  4. data/lib/advanced_billing/api_helper.rb +10 -0
  5. data/lib/advanced_billing/client.rb +242 -0
  6. data/lib/advanced_billing/configuration.rb +123 -0
  7. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +115 -0
  8. data/lib/advanced_billing/controllers/api_exports_controller.rb +262 -0
  9. data/lib/advanced_billing/controllers/base_controller.rb +75 -0
  10. data/lib/advanced_billing/controllers/billing_portal_controller.rb +162 -0
  11. data/lib/advanced_billing/controllers/components_controller.rb +908 -0
  12. data/lib/advanced_billing/controllers/coupons_controller.rb +667 -0
  13. data/lib/advanced_billing/controllers/custom_fields_controller.rb +443 -0
  14. data/lib/advanced_billing/controllers/customers_controller.rb +246 -0
  15. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +298 -0
  16. data/lib/advanced_billing/controllers/events_controller.rb +226 -0
  17. data/lib/advanced_billing/controllers/insights_controller.rb +161 -0
  18. data/lib/advanced_billing/controllers/invoices_controller.rb +947 -0
  19. data/lib/advanced_billing/controllers/offers_controller.rb +135 -0
  20. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +745 -0
  21. data/lib/advanced_billing/controllers/product_families_controller.rb +187 -0
  22. data/lib/advanced_billing/controllers/product_price_points_controller.rb +461 -0
  23. data/lib/advanced_billing/controllers/products_controller.rb +224 -0
  24. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +359 -0
  25. data/lib/advanced_billing/controllers/reason_codes_controller.rb +154 -0
  26. data/lib/advanced_billing/controllers/referral_codes_controller.rb +41 -0
  27. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +189 -0
  28. data/lib/advanced_billing/controllers/sites_controller.rb +90 -0
  29. data/lib/advanced_billing/controllers/subscription_components_controller.rb +982 -0
  30. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +155 -0
  31. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +157 -0
  32. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +295 -0
  33. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +216 -0
  34. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +156 -0
  35. data/lib/advanced_billing/controllers/subscription_products_controller.rb +166 -0
  36. data/lib/advanced_billing/controllers/subscription_status_controller.rb +479 -0
  37. data/lib/advanced_billing/controllers/subscriptions_controller.rb +1345 -0
  38. data/lib/advanced_billing/controllers/webhooks_controller.rb +206 -0
  39. data/lib/advanced_billing/exceptions/api_exception.rb +10 -0
  40. data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +41 -0
  41. data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +41 -0
  42. data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +34 -0
  43. data/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +32 -0
  44. data/lib/advanced_billing/exceptions/error_list_response_exception.rb +32 -0
  45. data/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +32 -0
  46. data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +32 -0
  47. data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +35 -0
  48. data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +32 -0
  49. data/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +32 -0
  50. data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +32 -0
  51. data/lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb +33 -0
  52. data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +32 -0
  53. data/lib/advanced_billing/exceptions/single_error_response_exception.rb +32 -0
  54. data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +32 -0
  55. data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +47 -0
  56. data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +41 -0
  57. data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +32 -0
  58. data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +32 -0
  59. data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +32 -0
  60. data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +32 -0
  61. data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +32 -0
  62. data/lib/advanced_billing/http/auth/basic_auth.rb +29 -0
  63. data/lib/advanced_billing/http/http_call_back.rb +10 -0
  64. data/lib/advanced_billing/http/http_method_enum.rb +10 -0
  65. data/lib/advanced_billing/http/http_request.rb +10 -0
  66. data/lib/advanced_billing/http/http_response.rb +10 -0
  67. data/lib/advanced_billing/models/account_balance.rb +51 -0
  68. data/lib/advanced_billing/models/account_balances.rb +83 -0
  69. data/lib/advanced_billing/models/ach_agreement.rb +88 -0
  70. data/lib/advanced_billing/models/activate_subscription_request.rb +57 -0
  71. data/lib/advanced_billing/models/add_coupons_request.rb +50 -0
  72. data/lib/advanced_billing/models/add_subscription_to_a_group.rb +62 -0
  73. data/lib/advanced_billing/models/agreement_acceptance.rb +117 -0
  74. data/lib/advanced_billing/models/allocate_components.rb +151 -0
  75. data/lib/advanced_billing/models/allocation.rb +340 -0
  76. data/lib/advanced_billing/models/allocation_expiration_date.rb +50 -0
  77. data/lib/advanced_billing/models/allocation_preview.rb +197 -0
  78. data/lib/advanced_billing/models/allocation_preview_direction.rb +23 -0
  79. data/lib/advanced_billing/models/allocation_preview_item.rb +272 -0
  80. data/lib/advanced_billing/models/allocation_preview_line_item.rb +135 -0
  81. data/lib/advanced_billing/models/allocation_preview_line_item_kind.rb +29 -0
  82. data/lib/advanced_billing/models/allocation_preview_response.rb +49 -0
  83. data/lib/advanced_billing/models/allocation_response.rb +50 -0
  84. data/lib/advanced_billing/models/allocation_settings.rb +79 -0
  85. data/lib/advanced_billing/models/applied_credit_note_data.rb +60 -0
  86. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +198 -0
  87. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +111 -0
  88. data/lib/advanced_billing/models/apply_payment_event_data.rb +150 -0
  89. data/lib/advanced_billing/models/attribute_error.rb +48 -0
  90. data/lib/advanced_billing/models/auto_invite.rb +23 -0
  91. data/lib/advanced_billing/models/auto_resume.rb +61 -0
  92. data/lib/advanced_billing/models/bank_account_attributes.rb +175 -0
  93. data/lib/advanced_billing/models/bank_account_holder_type.rb +23 -0
  94. data/lib/advanced_billing/models/bank_account_payment_profile.rb +310 -0
  95. data/lib/advanced_billing/models/bank_account_response.rb +49 -0
  96. data/lib/advanced_billing/models/bank_account_type.rb +23 -0
  97. data/lib/advanced_billing/models/bank_account_vault.rb +32 -0
  98. data/lib/advanced_billing/models/bank_account_verification.rb +62 -0
  99. data/lib/advanced_billing/models/bank_account_verification_request.rb +50 -0
  100. data/lib/advanced_billing/models/base_model.rb +62 -0
  101. data/lib/advanced_billing/models/base_refund_error.rb +50 -0
  102. data/lib/advanced_billing/models/base_string_error.rb +50 -0
  103. data/lib/advanced_billing/models/basic_date_field.rb +23 -0
  104. data/lib/advanced_billing/models/batch_job.rb +94 -0
  105. data/lib/advanced_billing/models/batch_job_response.rb +48 -0
  106. data/lib/advanced_billing/models/billing_address.rb +107 -0
  107. data/lib/advanced_billing/models/billing_manifest.rb +147 -0
  108. data/lib/advanced_billing/models/billing_manifest_item.rb +189 -0
  109. data/lib/advanced_billing/models/billing_manifest_line_item_kind.rb +35 -0
  110. data/lib/advanced_billing/models/billing_schedule.rb +55 -0
  111. data/lib/advanced_billing/models/breakouts.rb +84 -0
  112. data/lib/advanced_billing/models/bulk_component_s_price_point_assignment.rb +59 -0
  113. data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +57 -0
  114. data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +59 -0
  115. data/lib/advanced_billing/models/bulk_create_segments.rb +59 -0
  116. data/lib/advanced_billing/models/bulk_update_segments.rb +59 -0
  117. data/lib/advanced_billing/models/bulk_update_segments_item.rb +80 -0
  118. data/lib/advanced_billing/models/calendar_billing.rb +79 -0
  119. data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +51 -0
  120. data/lib/advanced_billing/models/cancellation_method.rb +33 -0
  121. data/lib/advanced_billing/models/cancellation_options.rb +63 -0
  122. data/lib/advanced_billing/models/cancellation_request.rb +48 -0
  123. data/lib/advanced_billing/models/card_type.rb +125 -0
  124. data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +81 -0
  125. data/lib/advanced_billing/models/chargify_ebb.rb +116 -0
  126. data/lib/advanced_billing/models/cleanup_scope.rb +26 -0
  127. data/lib/advanced_billing/models/collection_method.rb +32 -0
  128. data/lib/advanced_billing/models/component.rb +495 -0
  129. data/lib/advanced_billing/models/component_allocation_change.rb +147 -0
  130. data/lib/advanced_billing/models/component_allocation_error_item.rb +80 -0
  131. data/lib/advanced_billing/models/component_cost_data.rb +128 -0
  132. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +94 -0
  133. data/lib/advanced_billing/models/component_currency_price.rb +102 -0
  134. data/lib/advanced_billing/models/component_currency_prices_response.rb +57 -0
  135. data/lib/advanced_billing/models/component_custom_price.rb +96 -0
  136. data/lib/advanced_billing/models/component_kind.rb +32 -0
  137. data/lib/advanced_billing/models/component_price.rb +127 -0
  138. data/lib/advanced_billing/models/component_price_point.rb +302 -0
  139. data/lib/advanced_billing/models/component_price_point_error_item.rb +70 -0
  140. data/lib/advanced_billing/models/component_price_point_item.rb +119 -0
  141. data/lib/advanced_billing/models/component_price_point_response.rb +48 -0
  142. data/lib/advanced_billing/models/component_price_points_response.rb +69 -0
  143. data/lib/advanced_billing/models/component_response.rb +48 -0
  144. data/lib/advanced_billing/models/component_s_price_point_assignment.rb +72 -0
  145. data/lib/advanced_billing/models/compounding_strategy.rb +23 -0
  146. data/lib/advanced_billing/models/consolidated_invoice.rb +59 -0
  147. data/lib/advanced_billing/models/count_response.rb +50 -0
  148. data/lib/advanced_billing/models/coupon.rb +384 -0
  149. data/lib/advanced_billing/models/coupon_currency.rb +80 -0
  150. data/lib/advanced_billing/models/coupon_currency_request.rb +57 -0
  151. data/lib/advanced_billing/models/coupon_currency_response.rb +59 -0
  152. data/lib/advanced_billing/models/coupon_response.rb +50 -0
  153. data/lib/advanced_billing/models/coupon_restriction.rb +92 -0
  154. data/lib/advanced_billing/models/coupon_subcodes.rb +50 -0
  155. data/lib/advanced_billing/models/coupon_subcodes_response.rb +71 -0
  156. data/lib/advanced_billing/models/coupon_usage.rb +118 -0
  157. data/lib/advanced_billing/models/create_allocation.rb +198 -0
  158. data/lib/advanced_billing/models/create_allocation_request.rb +48 -0
  159. data/lib/advanced_billing/models/create_component_price_point.rb +163 -0
  160. data/lib/advanced_billing/models/create_component_price_point_request.rb +64 -0
  161. data/lib/advanced_billing/models/create_component_price_points_request.rb +64 -0
  162. data/lib/advanced_billing/models/create_currency_price.rb +70 -0
  163. data/lib/advanced_billing/models/create_currency_prices_request.rb +57 -0
  164. data/lib/advanced_billing/models/create_customer.rb +221 -0
  165. data/lib/advanced_billing/models/create_customer_request.rb +48 -0
  166. data/lib/advanced_billing/models/create_ebb_component.rb +49 -0
  167. data/lib/advanced_billing/models/create_invoice.rb +168 -0
  168. data/lib/advanced_billing/models/create_invoice_address.rb +130 -0
  169. data/lib/advanced_billing/models/create_invoice_coupon.rb +117 -0
  170. data/lib/advanced_billing/models/create_invoice_item.rb +192 -0
  171. data/lib/advanced_billing/models/create_invoice_payment.rb +92 -0
  172. data/lib/advanced_billing/models/create_invoice_payment_application.rb +58 -0
  173. data/lib/advanced_billing/models/create_invoice_payment_request.rb +59 -0
  174. data/lib/advanced_billing/models/create_invoice_request.rb +48 -0
  175. data/lib/advanced_billing/models/create_invoice_status.rb +23 -0
  176. data/lib/advanced_billing/models/create_metadata.rb +60 -0
  177. data/lib/advanced_billing/models/create_metadata_request.rb +57 -0
  178. data/lib/advanced_billing/models/create_metafield.rb +96 -0
  179. data/lib/advanced_billing/models/create_metafields_request.rb +64 -0
  180. data/lib/advanced_billing/models/create_metered_component.rb +49 -0
  181. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +133 -0
  182. data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +48 -0
  183. data/lib/advanced_billing/models/create_offer.rb +117 -0
  184. data/lib/advanced_billing/models/create_offer_component.rb +61 -0
  185. data/lib/advanced_billing/models/create_offer_request.rb +48 -0
  186. data/lib/advanced_billing/models/create_on_off_component.rb +49 -0
  187. data/lib/advanced_billing/models/create_or_update_coupon.rb +86 -0
  188. data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +228 -0
  189. data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +229 -0
  190. data/lib/advanced_billing/models/create_or_update_product.rb +146 -0
  191. data/lib/advanced_billing/models/create_or_update_product_request.rb +48 -0
  192. data/lib/advanced_billing/models/create_or_update_segment_price.rb +88 -0
  193. data/lib/advanced_billing/models/create_payment.rb +77 -0
  194. data/lib/advanced_billing/models/create_payment_profile.rb +430 -0
  195. data/lib/advanced_billing/models/create_payment_profile_request.rb +49 -0
  196. data/lib/advanced_billing/models/create_prepaid_component.rb +49 -0
  197. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +197 -0
  198. data/lib/advanced_billing/models/create_prepayment.rb +93 -0
  199. data/lib/advanced_billing/models/create_prepayment_request.rb +48 -0
  200. data/lib/advanced_billing/models/create_prepayment_response.rb +48 -0
  201. data/lib/advanced_billing/models/create_product_currency_price.rb +66 -0
  202. data/lib/advanced_billing/models/create_product_currency_prices_request.rb +57 -0
  203. data/lib/advanced_billing/models/create_product_family.rb +62 -0
  204. data/lib/advanced_billing/models/create_product_family_request.rb +49 -0
  205. data/lib/advanced_billing/models/create_product_price_point.rb +198 -0
  206. data/lib/advanced_billing/models/create_product_price_point_request.rb +48 -0
  207. data/lib/advanced_billing/models/create_quantity_based_component.rb +50 -0
  208. data/lib/advanced_billing/models/create_reason_code.rb +68 -0
  209. data/lib/advanced_billing/models/create_reason_code_request.rb +48 -0
  210. data/lib/advanced_billing/models/create_segment.rb +143 -0
  211. data/lib/advanced_billing/models/create_segment_request.rb +48 -0
  212. data/lib/advanced_billing/models/create_subscription.rb +749 -0
  213. data/lib/advanced_billing/models/create_subscription_component.rb +127 -0
  214. data/lib/advanced_billing/models/create_subscription_group.rb +75 -0
  215. data/lib/advanced_billing/models/create_subscription_group_request.rb +49 -0
  216. data/lib/advanced_billing/models/create_subscription_request.rb +48 -0
  217. data/lib/advanced_billing/models/create_usage.rb +88 -0
  218. data/lib/advanced_billing/models/create_usage_request.rb +48 -0
  219. data/lib/advanced_billing/models/created_prepayment.rb +117 -0
  220. data/lib/advanced_billing/models/credit_account_balance_changed.rb +122 -0
  221. data/lib/advanced_billing/models/credit_card_attributes.rb +72 -0
  222. data/lib/advanced_billing/models/credit_card_payment_profile.rb +306 -0
  223. data/lib/advanced_billing/models/credit_note.rb +417 -0
  224. data/lib/advanced_billing/models/credit_note1.rb +409 -0
  225. data/lib/advanced_billing/models/credit_note_application.rb +92 -0
  226. data/lib/advanced_billing/models/credit_note_line_item.rb +245 -0
  227. data/lib/advanced_billing/models/credit_note_status.rb +23 -0
  228. data/lib/advanced_billing/models/credit_scheme.rb +26 -0
  229. data/lib/advanced_billing/models/credit_scheme_request.rb +48 -0
  230. data/lib/advanced_billing/models/credit_type.rb +28 -0
  231. data/lib/advanced_billing/models/currency_price.rb +102 -0
  232. data/lib/advanced_billing/models/currency_price_role.rb +26 -0
  233. data/lib/advanced_billing/models/currency_prices_response.rb +57 -0
  234. data/lib/advanced_billing/models/current_vault.rb +99 -0
  235. data/lib/advanced_billing/models/custom_field_value_change.rb +148 -0
  236. data/lib/advanced_billing/models/customer.rb +358 -0
  237. data/lib/advanced_billing/models/customer1.rb +114 -0
  238. data/lib/advanced_billing/models/customer_attributes.rb +243 -0
  239. data/lib/advanced_billing/models/customer_billing_address_change.rb +60 -0
  240. data/lib/advanced_billing/models/customer_change.rb +83 -0
  241. data/lib/advanced_billing/models/customer_changes_preview_response.rb +48 -0
  242. data/lib/advanced_billing/models/customer_custom_fields_change.rb +78 -0
  243. data/lib/advanced_billing/models/customer_error.rb +60 -0
  244. data/lib/advanced_billing/models/customer_payer_change.rb +60 -0
  245. data/lib/advanced_billing/models/customer_response.rb +48 -0
  246. data/lib/advanced_billing/models/customer_shipping_address_change.rb +60 -0
  247. data/lib/advanced_billing/models/deduct_service_credit.rb +81 -0
  248. data/lib/advanced_billing/models/deduct_service_credit_request.rb +48 -0
  249. data/lib/advanced_billing/models/delayed_cancellation_response.rb +50 -0
  250. data/lib/advanced_billing/models/delete_subscription_group_response.rb +60 -0
  251. data/lib/advanced_billing/models/direction.rb +23 -0
  252. data/lib/advanced_billing/models/discount_type.rb +23 -0
  253. data/lib/advanced_billing/models/dunner_data.rb +96 -0
  254. data/lib/advanced_billing/models/dunning_step_data.rb +120 -0
  255. data/lib/advanced_billing/models/dunning_step_reached.rb +92 -0
  256. data/lib/advanced_billing/models/ebb_component.rb +301 -0
  257. data/lib/advanced_billing/models/ebb_event.rb +50 -0
  258. data/lib/advanced_billing/models/enable_webhooks_request.rb +49 -0
  259. data/lib/advanced_billing/models/enable_webhooks_response.rb +51 -0
  260. data/lib/advanced_billing/models/endpoint.rb +91 -0
  261. data/lib/advanced_billing/models/endpoint_response.rb +50 -0
  262. data/lib/advanced_billing/models/errors.rb +60 -0
  263. data/lib/advanced_billing/models/event.rb +150 -0
  264. data/lib/advanced_billing/models/event_based_billing_segment_error.rb +51 -0
  265. data/lib/advanced_billing/models/event_response.rb +48 -0
  266. data/lib/advanced_billing/models/event_type.rb +121 -0
  267. data/lib/advanced_billing/models/extended_interval_unit.rb +26 -0
  268. data/lib/advanced_billing/models/failed_payment_action.rb +37 -0
  269. data/lib/advanced_billing/models/first_charge_type.rb +26 -0
  270. data/lib/advanced_billing/models/full_subscription_group_response.rb +171 -0
  271. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +261 -0
  272. data/lib/advanced_billing/models/get_one_time_token_request.rb +49 -0
  273. data/lib/advanced_billing/models/group_billing.rb +77 -0
  274. data/lib/advanced_billing/models/group_settings.rb +75 -0
  275. data/lib/advanced_billing/models/group_target.rb +62 -0
  276. data/lib/advanced_billing/models/group_target_type.rb +32 -0
  277. data/lib/advanced_billing/models/include_not_null.rb +20 -0
  278. data/lib/advanced_billing/models/include_option.rb +23 -0
  279. data/lib/advanced_billing/models/interval_unit.rb +23 -0
  280. data/lib/advanced_billing/models/invoice.rb +734 -0
  281. data/lib/advanced_billing/models/invoice_address.rb +107 -0
  282. data/lib/advanced_billing/models/invoice_balance_item.rb +71 -0
  283. data/lib/advanced_billing/models/invoice_consolidation_level.rb +34 -0
  284. data/lib/advanced_billing/models/invoice_credit.rb +123 -0
  285. data/lib/advanced_billing/models/invoice_custom_field.rb +80 -0
  286. data/lib/advanced_billing/models/invoice_customer.rb +115 -0
  287. data/lib/advanced_billing/models/invoice_date_field.rb +32 -0
  288. data/lib/advanced_billing/models/invoice_discount.rb +174 -0
  289. data/lib/advanced_billing/models/invoice_discount_breakout.rb +72 -0
  290. data/lib/advanced_billing/models/invoice_display_settings.rb +65 -0
  291. data/lib/advanced_billing/models/invoice_event.rb +105 -0
  292. data/lib/advanced_billing/models/invoice_event1.rb +399 -0
  293. data/lib/advanced_billing/models/invoice_event_type.rb +59 -0
  294. data/lib/advanced_billing/models/invoice_issued.rb +258 -0
  295. data/lib/advanced_billing/models/invoice_line_item.rb +332 -0
  296. data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +69 -0
  297. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +266 -0
  298. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +60 -0
  299. data/lib/advanced_billing/models/invoice_payer.rb +103 -0
  300. data/lib/advanced_billing/models/invoice_payment.rb +158 -0
  301. data/lib/advanced_billing/models/invoice_payment_application.rb +74 -0
  302. data/lib/advanced_billing/models/invoice_payment_method.rb +124 -0
  303. data/lib/advanced_billing/models/invoice_payment_method_type.rb +35 -0
  304. data/lib/advanced_billing/models/invoice_payment_type.rb +29 -0
  305. data/lib/advanced_billing/models/invoice_pre_payment.rb +75 -0
  306. data/lib/advanced_billing/models/invoice_previous_balance.rb +78 -0
  307. data/lib/advanced_billing/models/invoice_refund.rb +106 -0
  308. data/lib/advanced_billing/models/invoice_response.rb +48 -0
  309. data/lib/advanced_billing/models/invoice_role.rb +47 -0
  310. data/lib/advanced_billing/models/invoice_seller.rb +83 -0
  311. data/lib/advanced_billing/models/invoice_sort_field.rb +41 -0
  312. data/lib/advanced_billing/models/invoice_status.rb +37 -0
  313. data/lib/advanced_billing/models/invoice_tax.rb +172 -0
  314. data/lib/advanced_billing/models/invoice_tax_breakout.rb +71 -0
  315. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +81 -0
  316. data/lib/advanced_billing/models/issue_advance_invoice_request.rb +50 -0
  317. data/lib/advanced_billing/models/issue_invoice_event_data.rb +136 -0
  318. data/lib/advanced_billing/models/issue_invoice_request.rb +63 -0
  319. data/lib/advanced_billing/models/issue_service_credit.rb +81 -0
  320. data/lib/advanced_billing/models/issue_service_credit_request.rb +49 -0
  321. data/lib/advanced_billing/models/item_category.rb +33 -0
  322. data/lib/advanced_billing/models/item_price_point_changed.rb +133 -0
  323. data/lib/advanced_billing/models/item_price_point_data.rb +70 -0
  324. data/lib/advanced_billing/models/line_item_kind.rb +47 -0
  325. data/lib/advanced_billing/models/line_item_transaction_type.rb +38 -0
  326. data/lib/advanced_billing/models/list_components_price_points_include.rb +20 -0
  327. data/lib/advanced_billing/models/list_components_price_points_response.rb +57 -0
  328. data/lib/advanced_billing/models/list_credit_notes_response.rb +57 -0
  329. data/lib/advanced_billing/models/list_events_date_field.rb +20 -0
  330. data/lib/advanced_billing/models/list_invoice_events_response.rb +89 -0
  331. data/lib/advanced_billing/models/list_invoices_response.rb +57 -0
  332. data/lib/advanced_billing/models/list_metafields_response.rb +99 -0
  333. data/lib/advanced_billing/models/list_mrr_response.rb +48 -0
  334. data/lib/advanced_billing/models/list_mrr_response_result.rb +120 -0
  335. data/lib/advanced_billing/models/list_offers_response.rb +59 -0
  336. data/lib/advanced_billing/models/list_product_price_points_response.rb +57 -0
  337. data/lib/advanced_billing/models/list_products_include.rb +20 -0
  338. data/lib/advanced_billing/models/list_products_price_points_include.rb +20 -0
  339. data/lib/advanced_billing/models/list_public_keys_meta.rb +80 -0
  340. data/lib/advanced_billing/models/list_public_keys_response.rb +69 -0
  341. data/lib/advanced_billing/models/list_sale_rep_item.rb +93 -0
  342. data/lib/advanced_billing/models/list_segments_response.rb +59 -0
  343. data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +142 -0
  344. data/lib/advanced_billing/models/list_subscription_components_include.rb +20 -0
  345. data/lib/advanced_billing/models/list_subscription_components_response.rb +57 -0
  346. data/lib/advanced_billing/models/list_subscription_components_sort.rb +23 -0
  347. data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +49 -0
  348. data/lib/advanced_billing/models/list_subscription_group_prepayment_date_field.rb +23 -0
  349. data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +57 -0
  350. data/lib/advanced_billing/models/list_subscription_groups_item.rb +146 -0
  351. data/lib/advanced_billing/models/list_subscription_groups_meta.rb +60 -0
  352. data/lib/advanced_billing/models/list_subscription_groups_response.rb +69 -0
  353. data/lib/advanced_billing/models/metadata.rb +102 -0
  354. data/lib/advanced_billing/models/metafield.rb +124 -0
  355. data/lib/advanced_billing/models/metafield_input.rb +33 -0
  356. data/lib/advanced_billing/models/metafield_scope.rb +113 -0
  357. data/lib/advanced_billing/models/metered_component.rb +323 -0
  358. data/lib/advanced_billing/models/metered_usage.rb +135 -0
  359. data/lib/advanced_billing/models/movement.rb +143 -0
  360. data/lib/advanced_billing/models/movement_line_item.rb +148 -0
  361. data/lib/advanced_billing/models/mrr.rb +103 -0
  362. data/lib/advanced_billing/models/mrr_movement.rb +81 -0
  363. data/lib/advanced_billing/models/mrr_response.rb +48 -0
  364. data/lib/advanced_billing/models/multi_invoice_payment.rb +92 -0
  365. data/lib/advanced_billing/models/multi_invoice_payment_response.rb +48 -0
  366. data/lib/advanced_billing/models/nested_subscription_group.rb +94 -0
  367. data/lib/advanced_billing/models/net_terms.rb +95 -0
  368. data/lib/advanced_billing/models/offer.rb +266 -0
  369. data/lib/advanced_billing/models/offer_discount.rb +70 -0
  370. data/lib/advanced_billing/models/offer_item.rb +159 -0
  371. data/lib/advanced_billing/models/offer_response.rb +50 -0
  372. data/lib/advanced_billing/models/offer_signup_page.rb +100 -0
  373. data/lib/advanced_billing/models/on_off_component.rb +287 -0
  374. data/lib/advanced_billing/models/organization_address.rb +129 -0
  375. data/lib/advanced_billing/models/origin_invoice.rb +60 -0
  376. data/lib/advanced_billing/models/overage_pricing.rb +73 -0
  377. data/lib/advanced_billing/models/override_subscription.rb +134 -0
  378. data/lib/advanced_billing/models/override_subscription_request.rb +48 -0
  379. data/lib/advanced_billing/models/paginated_metadata.rb +99 -0
  380. data/lib/advanced_billing/models/pause_request.rb +50 -0
  381. data/lib/advanced_billing/models/payer_attributes.rb +223 -0
  382. data/lib/advanced_billing/models/payer_error.rb +70 -0
  383. data/lib/advanced_billing/models/payment.rb +82 -0
  384. data/lib/advanced_billing/models/payment_collection_method_changed.rb +80 -0
  385. data/lib/advanced_billing/models/payment_for_allocation.rb +91 -0
  386. data/lib/advanced_billing/models/payment_method_apple_pay_type.rb +60 -0
  387. data/lib/advanced_billing/models/payment_method_bank_account_type.rb +94 -0
  388. data/lib/advanced_billing/models/payment_method_credit_card_type.rb +117 -0
  389. data/lib/advanced_billing/models/payment_method_external_type.rb +105 -0
  390. data/lib/advanced_billing/models/payment_method_nested_data.rb +156 -0
  391. data/lib/advanced_billing/models/payment_method_nested_data1.rb +148 -0
  392. data/lib/advanced_billing/models/payment_method_paypal_type.rb +79 -0
  393. data/lib/advanced_billing/models/payment_profile_attributes.rb +370 -0
  394. data/lib/advanced_billing/models/payment_profile_response.rb +64 -0
  395. data/lib/advanced_billing/models/payment_related_events.rb +80 -0
  396. data/lib/advanced_billing/models/payment_response.rb +69 -0
  397. data/lib/advanced_billing/models/payment_type.rb +26 -0
  398. data/lib/advanced_billing/models/pending_cancellation_change.rb +80 -0
  399. data/lib/advanced_billing/models/portal_management_link.rb +104 -0
  400. data/lib/advanced_billing/models/prepaid_component_price_point.rb +107 -0
  401. data/lib/advanced_billing/models/prepaid_configuration.rb +105 -0
  402. data/lib/advanced_billing/models/prepaid_configuration_response.rb +49 -0
  403. data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +111 -0
  404. data/lib/advanced_billing/models/prepaid_usage.rb +200 -0
  405. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +71 -0
  406. data/lib/advanced_billing/models/prepaid_usage_component.rb +358 -0
  407. data/lib/advanced_billing/models/prepayment.rb +137 -0
  408. data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +109 -0
  409. data/lib/advanced_billing/models/prepayment_aggregated_error.rb +71 -0
  410. data/lib/advanced_billing/models/prepayment_method.rb +41 -0
  411. data/lib/advanced_billing/models/prepayment_response.rb +48 -0
  412. data/lib/advanced_billing/models/prepayments_response.rb +59 -0
  413. data/lib/advanced_billing/models/preview_allocations_request.rb +99 -0
  414. data/lib/advanced_billing/models/price.rb +99 -0
  415. data/lib/advanced_billing/models/price_point.rb +206 -0
  416. data/lib/advanced_billing/models/price_point_type.rb +30 -0
  417. data/lib/advanced_billing/models/pricing_scheme.rb +31 -0
  418. data/lib/advanced_billing/models/product.rb +547 -0
  419. data/lib/advanced_billing/models/product_family.rb +114 -0
  420. data/lib/advanced_billing/models/product_family_response.rb +50 -0
  421. data/lib/advanced_billing/models/product_price_point.rb +346 -0
  422. data/lib/advanced_billing/models/product_price_point_errors.rb +101 -0
  423. data/lib/advanced_billing/models/product_price_point_response.rb +48 -0
  424. data/lib/advanced_billing/models/product_response.rb +48 -0
  425. data/lib/advanced_billing/models/proforma_custom_field.rb +90 -0
  426. data/lib/advanced_billing/models/proforma_error.rb +51 -0
  427. data/lib/advanced_billing/models/proforma_invoice.rb +484 -0
  428. data/lib/advanced_billing/models/proforma_invoice_credit.rb +82 -0
  429. data/lib/advanced_billing/models/proforma_invoice_discount.rb +111 -0
  430. data/lib/advanced_billing/models/proforma_invoice_discount_breakout.rb +62 -0
  431. data/lib/advanced_billing/models/proforma_invoice_issued.rb +205 -0
  432. data/lib/advanced_billing/models/proforma_invoice_payment.rb +82 -0
  433. data/lib/advanced_billing/models/proforma_invoice_preview.rb +484 -0
  434. data/lib/advanced_billing/models/proforma_invoice_tax.rb +120 -0
  435. data/lib/advanced_billing/models/proforma_invoice_tax_breakout.rb +61 -0
  436. data/lib/advanced_billing/models/proration.rb +52 -0
  437. data/lib/advanced_billing/models/public_key.rb +71 -0
  438. data/lib/advanced_billing/models/public_signup_page.rb +84 -0
  439. data/lib/advanced_billing/models/quantity_based_component.rb +333 -0
  440. data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +61 -0
  441. data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +135 -0
  442. data/lib/advanced_billing/models/reactivate_subscription_request.rb +125 -0
  443. data/lib/advanced_billing/models/reactivation_billing.rb +56 -0
  444. data/lib/advanced_billing/models/reactivation_charge.rb +30 -0
  445. data/lib/advanced_billing/models/reason_code.rb +110 -0
  446. data/lib/advanced_billing/models/reason_code_response.rb +48 -0
  447. data/lib/advanced_billing/models/reason_codes_json_response.rb +50 -0
  448. data/lib/advanced_billing/models/record_payment_request.rb +48 -0
  449. data/lib/advanced_billing/models/recurring_scheme.rb +26 -0
  450. data/lib/advanced_billing/models/referral_code.rb +81 -0
  451. data/lib/advanced_billing/models/referral_validation_response.rb +50 -0
  452. data/lib/advanced_billing/models/refund.rb +128 -0
  453. data/lib/advanced_billing/models/refund_consolidated_invoice.rb +129 -0
  454. data/lib/advanced_billing/models/refund_invoice.rb +128 -0
  455. data/lib/advanced_billing/models/refund_invoice_event_data.rb +195 -0
  456. data/lib/advanced_billing/models/refund_invoice_request.rb +64 -0
  457. data/lib/advanced_billing/models/refund_prepayment.rb +108 -0
  458. data/lib/advanced_billing/models/refund_prepayment_aggregated_error.rb +50 -0
  459. data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +50 -0
  460. data/lib/advanced_billing/models/refund_prepayment_request.rb +48 -0
  461. data/lib/advanced_billing/models/refund_success.rb +93 -0
  462. data/lib/advanced_billing/models/remove_payment_event_data.rb +155 -0
  463. data/lib/advanced_billing/models/renewal_preview.rb +161 -0
  464. data/lib/advanced_billing/models/renewal_preview_component.rb +93 -0
  465. data/lib/advanced_billing/models/renewal_preview_line_item.rb +189 -0
  466. data/lib/advanced_billing/models/renewal_preview_request.rb +62 -0
  467. data/lib/advanced_billing/models/renewal_preview_response.rb +49 -0
  468. data/lib/advanced_billing/models/replay_webhooks_request.rb +48 -0
  469. data/lib/advanced_billing/models/replay_webhooks_response.rb +50 -0
  470. data/lib/advanced_billing/models/resent_invitation.rb +83 -0
  471. data/lib/advanced_billing/models/resource_type.rb +23 -0
  472. data/lib/advanced_billing/models/restriction_type.rb +23 -0
  473. data/lib/advanced_billing/models/resume_options.rb +76 -0
  474. data/lib/advanced_billing/models/resumption_charge.rb +27 -0
  475. data/lib/advanced_billing/models/revoked_invitation.rb +72 -0
  476. data/lib/advanced_billing/models/sale_rep.rb +100 -0
  477. data/lib/advanced_billing/models/sale_rep_item_mrr.rb +70 -0
  478. data/lib/advanced_billing/models/sale_rep_settings.rb +113 -0
  479. data/lib/advanced_billing/models/sale_rep_subscription.rb +143 -0
  480. data/lib/advanced_billing/models/segment.rb +210 -0
  481. data/lib/advanced_billing/models/segment_price.rb +126 -0
  482. data/lib/advanced_billing/models/segment_response.rb +50 -0
  483. data/lib/advanced_billing/models/seller.rb +82 -0
  484. data/lib/advanced_billing/models/send_invoice_request.rb +73 -0
  485. data/lib/advanced_billing/models/service_credit.rb +92 -0
  486. data/lib/advanced_billing/models/service_credit_response.rb +48 -0
  487. data/lib/advanced_billing/models/service_credit_type.rb +23 -0
  488. data/lib/advanced_billing/models/shipping_address.rb +107 -0
  489. data/lib/advanced_billing/models/signup_proforma_preview.rb +62 -0
  490. data/lib/advanced_billing/models/signup_proforma_preview_response.rb +50 -0
  491. data/lib/advanced_billing/models/site.rb +220 -0
  492. data/lib/advanced_billing/models/site_response.rb +48 -0
  493. data/lib/advanced_billing/models/site_statistics.rb +174 -0
  494. data/lib/advanced_billing/models/site_summary.rb +90 -0
  495. data/lib/advanced_billing/models/snap_day.rb +21 -0
  496. data/lib/advanced_billing/models/sorting_direction.rb +23 -0
  497. data/lib/advanced_billing/models/subscription.rb +1014 -0
  498. data/lib/advanced_billing/models/subscription_component.rb +460 -0
  499. data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +60 -0
  500. data/lib/advanced_billing/models/subscription_component_response.rb +50 -0
  501. data/lib/advanced_billing/models/subscription_component_subscription.rb +197 -0
  502. data/lib/advanced_billing/models/subscription_custom_price.rb +212 -0
  503. data/lib/advanced_billing/models/subscription_date_field.rb +44 -0
  504. data/lib/advanced_billing/models/subscription_group.rb +96 -0
  505. data/lib/advanced_billing/models/subscription_group_balances.rb +82 -0
  506. data/lib/advanced_billing/models/subscription_group_bank_account.rb +216 -0
  507. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +96 -0
  508. data/lib/advanced_billing/models/subscription_group_credit_card.rb +273 -0
  509. data/lib/advanced_billing/models/subscription_group_customer.rb +90 -0
  510. data/lib/advanced_billing/models/subscription_group_item.rb +152 -0
  511. data/lib/advanced_billing/models/subscription_group_member_error.rb +70 -0
  512. data/lib/advanced_billing/models/subscription_group_payment_profile.rb +81 -0
  513. data/lib/advanced_billing/models/subscription_group_prepayment.rb +75 -0
  514. data/lib/advanced_billing/models/subscription_group_prepayment_method.rb +35 -0
  515. data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +48 -0
  516. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +92 -0
  517. data/lib/advanced_billing/models/subscription_group_response.rb +49 -0
  518. data/lib/advanced_billing/models/subscription_group_signup.rb +154 -0
  519. data/lib/advanced_billing/models/subscription_group_signup_component.rb +110 -0
  520. data/lib/advanced_billing/models/subscription_group_signup_error.rb +112 -0
  521. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +83 -0
  522. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +140 -0
  523. data/lib/advanced_billing/models/subscription_group_signup_item.rb +197 -0
  524. data/lib/advanced_billing/models/subscription_group_signup_request.rb +49 -0
  525. data/lib/advanced_billing/models/subscription_group_signup_response.rb +171 -0
  526. data/lib/advanced_billing/models/subscription_group_signup_success.rb +81 -0
  527. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +125 -0
  528. data/lib/advanced_billing/models/subscription_group_subscription_error.rb +87 -0
  529. data/lib/advanced_billing/models/subscription_group_update_error.rb +59 -0
  530. data/lib/advanced_billing/models/subscription_include.rb +23 -0
  531. data/lib/advanced_billing/models/subscription_included_coupon.rb +115 -0
  532. data/lib/advanced_billing/models/subscription_list_date_field.rb +20 -0
  533. data/lib/advanced_billing/models/subscription_list_include.rb +20 -0
  534. data/lib/advanced_billing/models/subscription_migration_preview.rb +90 -0
  535. data/lib/advanced_billing/models/subscription_migration_preview_options.rb +163 -0
  536. data/lib/advanced_billing/models/subscription_migration_preview_request.rb +49 -0
  537. data/lib/advanced_billing/models/subscription_migration_preview_response.rb +48 -0
  538. data/lib/advanced_billing/models/subscription_mrr.rb +70 -0
  539. data/lib/advanced_billing/models/subscription_mrr_breakout.rb +59 -0
  540. data/lib/advanced_billing/models/subscription_mrr_response.rb +57 -0
  541. data/lib/advanced_billing/models/subscription_note.rb +101 -0
  542. data/lib/advanced_billing/models/subscription_note_response.rb +48 -0
  543. data/lib/advanced_billing/models/subscription_preview.rb +62 -0
  544. data/lib/advanced_billing/models/subscription_preview_response.rb +49 -0
  545. data/lib/advanced_billing/models/subscription_product_change.rb +81 -0
  546. data/lib/advanced_billing/models/subscription_product_migration.rb +152 -0
  547. data/lib/advanced_billing/models/subscription_product_migration_request.rb +48 -0
  548. data/lib/advanced_billing/models/subscription_purge_type.rb +23 -0
  549. data/lib/advanced_billing/models/subscription_response.rb +50 -0
  550. data/lib/advanced_billing/models/subscription_sort.rb +35 -0
  551. data/lib/advanced_billing/models/subscription_state.rb +118 -0
  552. data/lib/advanced_billing/models/subscription_state_change.rb +81 -0
  553. data/lib/advanced_billing/models/subscription_state_filter.rb +53 -0
  554. data/lib/advanced_billing/models/tax_configuration.rb +74 -0
  555. data/lib/advanced_billing/models/tax_configuration_kind.rb +29 -0
  556. data/lib/advanced_billing/models/tax_destination_address.rb +29 -0
  557. data/lib/advanced_billing/models/too_many_management_link_requests.rb +64 -0
  558. data/lib/advanced_billing/models/update_allocation_expiration_date.rb +50 -0
  559. data/lib/advanced_billing/models/update_component.rb +146 -0
  560. data/lib/advanced_billing/models/update_component_price_point.rb +141 -0
  561. data/lib/advanced_billing/models/update_component_price_point_request.rb +51 -0
  562. data/lib/advanced_billing/models/update_component_request.rb +48 -0
  563. data/lib/advanced_billing/models/update_coupon_currency.rb +57 -0
  564. data/lib/advanced_billing/models/update_currency_price.rb +57 -0
  565. data/lib/advanced_billing/models/update_currency_prices_request.rb +57 -0
  566. data/lib/advanced_billing/models/update_customer.rb +223 -0
  567. data/lib/advanced_billing/models/update_customer_request.rb +48 -0
  568. data/lib/advanced_billing/models/update_endpoint.rb +58 -0
  569. data/lib/advanced_billing/models/update_endpoint_request.rb +48 -0
  570. data/lib/advanced_billing/models/update_metadata.rb +70 -0
  571. data/lib/advanced_billing/models/update_metadata_request.rb +50 -0
  572. data/lib/advanced_billing/models/update_metafield.rb +106 -0
  573. data/lib/advanced_billing/models/update_metafields_request.rb +62 -0
  574. data/lib/advanced_billing/models/update_payment_profile.rb +194 -0
  575. data/lib/advanced_billing/models/update_payment_profile_request.rb +49 -0
  576. data/lib/advanced_billing/models/update_price.rb +109 -0
  577. data/lib/advanced_billing/models/update_product_price_point.rb +61 -0
  578. data/lib/advanced_billing/models/update_product_price_point_request.rb +48 -0
  579. data/lib/advanced_billing/models/update_reason_code.rb +70 -0
  580. data/lib/advanced_billing/models/update_reason_code_request.rb +48 -0
  581. data/lib/advanced_billing/models/update_segment.rb +73 -0
  582. data/lib/advanced_billing/models/update_segment_request.rb +48 -0
  583. data/lib/advanced_billing/models/update_subscription.rb +277 -0
  584. data/lib/advanced_billing/models/update_subscription_component.rb +61 -0
  585. data/lib/advanced_billing/models/update_subscription_group.rb +50 -0
  586. data/lib/advanced_billing/models/update_subscription_group_request.rb +49 -0
  587. data/lib/advanced_billing/models/update_subscription_note.rb +57 -0
  588. data/lib/advanced_billing/models/update_subscription_note_request.rb +48 -0
  589. data/lib/advanced_billing/models/update_subscription_request.rb +48 -0
  590. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +95 -0
  591. data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +49 -0
  592. data/lib/advanced_billing/models/usage.rb +155 -0
  593. data/lib/advanced_billing/models/usage_response.rb +48 -0
  594. data/lib/advanced_billing/models/void_invoice.rb +48 -0
  595. data/lib/advanced_billing/models/void_invoice_event_data.rb +148 -0
  596. data/lib/advanced_billing/models/void_invoice_request.rb +48 -0
  597. data/lib/advanced_billing/models/void_remainder_event_data.rb +115 -0
  598. data/lib/advanced_billing/models/webhook.rb +173 -0
  599. data/lib/advanced_billing/models/webhook_order.rb +23 -0
  600. data/lib/advanced_billing/models/webhook_response.rb +50 -0
  601. data/lib/advanced_billing/models/webhook_status.rb +29 -0
  602. data/lib/advanced_billing/models/webhook_subscription.rb +124 -0
  603. data/lib/advanced_billing/utilities/date_time_helper.rb +11 -0
  604. data/lib/advanced_billing/utilities/file_wrapper.rb +16 -0
  605. data/lib/advanced_billing/utilities/union_type_lookup.rb +1098 -0
  606. data/lib/advanced_billing.rb +670 -0
  607. metadata +607 -105
  608. data/bin/arch +0 -1
  609. data/bin/ash +0 -1
  610. data/bin/base64 +0 -1
  611. data/bin/bbconfig +0 -1
  612. data/bin/busybox +0 -0
  613. data/bin/cat +0 -1
  614. data/bin/chattr +0 -1
  615. data/bin/chgrp +0 -1
  616. data/bin/chmod +0 -1
  617. data/bin/chown +0 -1
  618. data/bin/cp +0 -1
  619. data/bin/date +0 -1
  620. data/bin/dd +0 -1
  621. data/bin/df +0 -1
  622. data/bin/dmesg +0 -1
  623. data/bin/dnsdomainname +0 -1
  624. data/bin/dumpkmap +0 -1
  625. data/bin/echo +0 -1
  626. data/bin/ed +0 -1
  627. data/bin/egrep +0 -1
  628. data/bin/false +0 -1
  629. data/bin/fatattr +0 -1
  630. data/bin/fdflush +0 -1
  631. data/bin/fgrep +0 -1
  632. data/bin/fsync +0 -1
  633. data/bin/getopt +0 -1
  634. data/bin/grep +0 -1
  635. data/bin/gunzip +0 -1
  636. data/bin/gzip +0 -1
  637. data/bin/hostname +0 -1
  638. data/bin/ionice +0 -1
  639. data/bin/iostat +0 -1
  640. data/bin/ipcalc +0 -1
  641. data/bin/kbd_mode +0 -1
  642. data/bin/kill +0 -1
  643. data/bin/link +0 -1
  644. data/bin/linux32 +0 -1
  645. data/bin/linux64 +0 -1
  646. data/bin/ln +0 -1
  647. data/bin/login +0 -1
  648. data/bin/ls +0 -1
  649. data/bin/lsattr +0 -1
  650. data/bin/lzop +0 -1
  651. data/bin/makemime +0 -1
  652. data/bin/mkdir +0 -1
  653. data/bin/mknod +0 -1
  654. data/bin/mktemp +0 -1
  655. data/bin/more +0 -1
  656. data/bin/mount +0 -1
  657. data/bin/mountpoint +0 -1
  658. data/bin/mpstat +0 -1
  659. data/bin/mv +0 -1
  660. data/bin/netstat +0 -1
  661. data/bin/nice +0 -1
  662. data/bin/pidof +0 -0
  663. data/bin/ping +0 -1
  664. data/bin/ping6 +0 -1
  665. data/bin/pipe_progress +0 -1
  666. data/bin/printenv +0 -1
  667. data/bin/ps +0 -0
  668. data/bin/pwait +0 -0
  669. data/bin/pwd +0 -1
  670. data/bin/reformime +0 -1
  671. data/bin/rev +0 -1
  672. data/bin/rm +0 -1
  673. data/bin/rmdir +0 -1
  674. data/bin/run-parts +0 -1
  675. data/bin/sed +0 -1
  676. data/bin/setpriv +0 -1
  677. data/bin/setserial +0 -1
  678. data/bin/sh +0 -1
  679. data/bin/slabtop +0 -0
  680. data/bin/sleep +0 -1
  681. data/bin/stat +0 -1
  682. data/bin/stty +0 -1
  683. data/bin/su +0 -1
  684. data/bin/sync +0 -1
  685. data/bin/tar +0 -1
  686. data/bin/tload +0 -0
  687. data/bin/touch +0 -1
  688. data/bin/true +0 -1
  689. data/bin/umount +0 -1
  690. data/bin/uname +0 -1
  691. data/bin/usleep +0 -1
  692. data/bin/vmstat +0 -0
  693. data/bin/w +0 -0
  694. data/bin/watch +0 -0
  695. data/bin/zcat +0 -1
  696. data/lib/apk/db/installed +0 -3582
  697. data/lib/apk/db/lock +0 -0
  698. data/lib/apk/db/scripts.tar +0 -0
  699. data/lib/apk/db/triggers +0 -2
  700. data/lib/ld-musl-x86_64.so.1 +0 -0
  701. data/lib/libapk.so.3.12.0 +0 -0
  702. data/lib/libc.musl-x86_64.so.1 +0 -1
  703. data/lib/libcrypto.so.1.1 +0 -0
  704. data/lib/libprocps.so.8 +0 -1
  705. data/lib/libprocps.so.8.0.3 +0 -0
  706. data/lib/libssl.so.1.1 +0 -0
  707. data/lib/libz.so +0 -1
  708. data/lib/libz.so.1 +0 -1
  709. data/lib/libz.so.1.2.12 +0 -0
  710. data/lib/sysctl.d/00-alpine.conf +0 -40
@@ -0,0 +1,1345 @@
1
+ # advanced_billing
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module AdvancedBilling
7
+ # SubscriptionsController
8
+ class SubscriptionsController < BaseController
9
+ # Full documentation on how subscriptions operate within Chargify can be
10
+ # located under the following topics:
11
+ # + [Subscriptions
12
+ # Reference](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577172
13
+ # 749-Subscription-Introduction)
14
+ # + [Subscriptions
15
+ # Actions](https://maxio-chargify.zendesk.com/hc/en-us/articles/540551055655
16
+ # 7-Actions)
17
+ # + [Subscription
18
+ # Cancellation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405510
19
+ # 556557-Actions#initiate-cancellation)
20
+ # + [Subscription
21
+ # Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559
22
+ # 291021-Reactivating-and-Resuming)
23
+ # + [Subscription
24
+ # Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821
25
+ # -Imports)
26
+ # When creating a subscription, you must specify a product and a customer.
27
+ # Credit card details may be required, depending on the options for the
28
+ # Product being subscribed ([see Product
29
+ # Options](https://maxio-chargify.zendesk.com/hc/en-us/articles/540524678222
30
+ # 1#payment-method-settings)).
31
+ # The product may be specified by `product_id` or by `product_handle` (API
32
+ # Handle). In similar fashion, to pass a particular product price point, you
33
+ # may either use `product_price_point_handle` or `product_price_point_id`.
34
+ # An existing customer may be specified by a `customer_id` (ID within
35
+ # Chargify) or a `customer_reference` (unique value within your app that you
36
+ # have shared with Chargify via the reference attribute on a customer). You
37
+ # may also pass in an existing payment profile for that customer with
38
+ # `payment_profile_id`. A new customer may be created by providing
39
+ # `customer_attributes`.
40
+ # Credit card details may be required, depending on the options for the
41
+ # product being subscribed. The product can be specified by `product_id` or
42
+ # by `product_handle` (API Handle).
43
+ # If you are creating a subscription with a payment profile, the attribute
44
+ # to send will be `credit_card_attributes` or `bank_account_attributes` for
45
+ # ACH and Direct Debit. That said, when you read the subscription after
46
+ # creation, we return the profile details under `credit_card` or
47
+ # `bank_account`.
48
+ # ## Taxable Subscriptions
49
+ # If your intent is to charge your subscribers tax via [Avalara
50
+ # Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405275711885-
51
+ # Avalara-VAT-Tax) or [Custom
52
+ # Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405069041549-
53
+ # Custom-Taxes), there are a few considerations to be made regarding
54
+ # collecting subscription data.
55
+ # For subscribers to be eligible to be taxed, the following information for
56
+ # the `customer` object or `payment_profile` object must by supplied:
57
+ # + A subscription to a [taxable
58
+ # product](https://maxio-chargify.zendesk.com/hc/en-us/articles/540524678222
59
+ # 1-Product-Editing#tax-settings)
60
+ # + [Full valid billing or shipping
61
+ # address](https://maxio-chargify.zendesk.com/hc/en-us/articles/540535611431
62
+ # 7#full-address-required-for-taxable-subscriptions) to identify the tax
63
+ # locale
64
+ # + The portion of the address that houses the [state
65
+ # information](https://maxio-chargify.zendesk.com/hc/en-us/articles/54053561
66
+ # 14317#required-state-format-for-taxable-subscriptions) of either adddress
67
+ # must adhere to the ISO standard of a 2-3 character limit/format.
68
+ # + The portion of the address that houses the [country
69
+ # information](https://maxio-chargify.zendesk.com/hc/en-us/articles/54053561
70
+ # 14317#required-country-format-for-taxable-subscriptions) must adhere to
71
+ # the ISO standard of a 2 character limit/format.
72
+ # ## Subscription Request Examples
73
+ # The subscription examples below will be split into two sections.
74
+ # The first section, "Subscription Customization", will focus on passing
75
+ # different information with a subscription, such as components, calendar
76
+ # billing, and custom fields. These examples will presume you are using a
77
+ # secure `chargify_token` generated by Chargify.js.
78
+ # The second section, "Passing Payment Information", will focus on passing
79
+ # payment information into Chargify. Please be aware that <b>collecting and
80
+ # sending Chargify raw card details requires PCI compliance on your end</b>;
81
+ # these examples are provided as guidance. If your business is not PCI
82
+ # compliant, we recommend using Chargify.js to collect credit cards or bank
83
+ # accounts.
84
+ # # Subscription Customization
85
+ # ## With Components
86
+ # Different components require slightly different data. For example,
87
+ # quantity-based and on/off components accept `allocated_quantity`, while
88
+ # metered components accept `unit_balance`.
89
+ # When creating a subscription with a component, a `price_point_id` can be
90
+ # passed in along with the `component_id` to specify which price point to
91
+ # use. If not passed in, the default price point will be used.
92
+ # Note: if an invalid `price_point_id` is used, the subscription will still
93
+ # proceed but will use the component's default price point.
94
+ # Components and their price points may be added by ID or by handle. See the
95
+ # example request body labeled "Components By Handle (Quantity-Based)"; the
96
+ # format will be the same for other component types.
97
+ # ## With Coupon(s)
98
+ # Pass an array of `coupon_codes`. See the example request body "With
99
+ # Coupon".
100
+ # ## With Manual Invoice Collection
101
+ # The `invoice` collection method works only on legacy Statement
102
+ # Architecture.
103
+ # On Relationship Invoicing Architecture use the `remittance` collection
104
+ # method.
105
+ # ## Prepaid Subscription
106
+ # A prepaid subscription can be created with the usual subscription creation
107
+ # parameters, specifying `prepaid` as the `payment_collection_method` and
108
+ # including a nested `prepaid_configuration`.
109
+ # After a prepaid subscription has been created, additional funds can be
110
+ # manually added to the prepayment account through the [Create Prepayment
111
+ # Endpoint](https://developers.chargify.com/docs/api-docs/7ec482de77ba7-crea
112
+ # te-prepayment).
113
+ # Prepaid subscriptions do not work on legacy Statement Architecture.
114
+ # ## With Metafields
115
+ # Metafields can either attach to subscriptions or customers. Metafields are
116
+ # popuplated with the supplied metadata to the resource specified.
117
+ # If the metafield doesn't exist yet, it will be created on-the-fly.
118
+ # ## With Custom Pricing
119
+ # Custom pricing is pricing specific to the subscription in question.
120
+ # Create a subscription with custom pricing by passing pricing information
121
+ # instead of a price point.
122
+ # For a custom priced product, pass the custom_price object in place of
123
+ # `product_price_point_id`. For a custom priced component, pass the
124
+ # `custom_price` object within the component object.
125
+ # Custom prices and price points can exist in harmony on a subscription.
126
+ # # Passing Payment Information
127
+ # ## Subscription with Chargify.js token
128
+ # The `chargify_token` can be obtained using
129
+ # [chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0
130
+ # NjAzNDI0-overview). The token represents payment profile attributes that
131
+ # were provided by the customer in their browser and stored at the payment
132
+ # gateway.
133
+ # The `payment_type` attribute may either be `credit_card` or
134
+ # `bank_account`, depending on the type of payment method being added. If a
135
+ # bank account is being passed, the payment attributes should be changed to
136
+ # `bank_account_attributes`.
137
+ # ```json
138
+ # {
139
+ # "subscription": {
140
+ # "product_handle": "pro-plan",
141
+ # "customer_attributes": {
142
+ # "first_name": "Joe",
143
+ # "last_name": "Smith",
144
+ # "email": "j.smith@example.com"
145
+ # },
146
+ # "credit_card_attributes": {
147
+ # "chargify_token": "tok_cwhvpfcnbtgkd8nfkzf9dnjn",
148
+ # "payment_type": "credit_card"
149
+ # }
150
+ # }
151
+ # }
152
+ # ```
153
+ # ## Subscription with vault token
154
+ # If you already have a customer and card stored in your payment gateway,
155
+ # you may create a subscription with a `vault_token`. Providing the
156
+ # last_four, card type and expiration date will allow the card to be
157
+ # displayed properly in the Chargify UI.
158
+ # ```json
159
+ # {
160
+ # "subscription": {
161
+ # "product_handle": "pro-plan",
162
+ # "customer_attributes": {
163
+ # "first_name": "Joe",
164
+ # "last_name": "Smith",
165
+ # "email": "j.smith@example.com"
166
+ # },
167
+ # "credit_card_attributes": {
168
+ # first_name: "Joe,
169
+ # last_name: "Smith",
170
+ # card_type: "visa",
171
+ # expiration_month: "05",
172
+ # expiration_year: "2025",
173
+ # last_four: "1234",
174
+ # vault_token: "12345abc",
175
+ # current_vault: "braintree_blue"
176
+ # }
177
+ # }
178
+ # ```
179
+ # ## Subscription with Credit Card
180
+ # ```json
181
+ # "subscription": {
182
+ # "product_handle": "basic",
183
+ # "customer_attributes": {
184
+ # "first_name": "Joe",
185
+ # "last_name": "Blow",
186
+ # "email": "joe@example.com",
187
+ # "zip": "02120",
188
+ # "state": "MA",
189
+ # "reference": "XYZ",
190
+ # "phone": "(617) 111 - 0000",
191
+ # "organization": "Acme",
192
+ # "country": "US",
193
+ # "city": "Boston",
194
+ # "address_2": null,
195
+ # "address": "123 Mass Ave."
196
+ # },
197
+ # "credit_card_attributes": {
198
+ # "last_name": "Smith",
199
+ # "first_name": "Joe",
200
+ # "full_number": "4111111111111111",
201
+ # "expiration_year": "2021",
202
+ # "expiration_month": "1",
203
+ # "card_type": "visa",
204
+ # "billing_zip": "02120",
205
+ # "billing_state": "MA",
206
+ # "billing_country": "US",
207
+ # "billing_city": "Boston",
208
+ # "billing_address_2": null,
209
+ # "billing_address": "123 Mass Ave."
210
+ # }
211
+ # }
212
+ # ```
213
+ # ## Subscription with ACH as Payment Profile
214
+ # ```json
215
+ # {
216
+ # "subscription": {
217
+ # "product_handle": "gold-product",
218
+ # "customer_attributes": {
219
+ # "first_name": "Joe",
220
+ # "last_name": "Blow",
221
+ # "email": "joe@example.com",
222
+ # "zip": "02120",
223
+ # "state": "MA",
224
+ # "reference": "XYZ",
225
+ # "phone": "(617) 111 - 0000",
226
+ # "organization": "Acme",
227
+ # "country": "US",
228
+ # "city": "Boston",
229
+ # "address_2": null,
230
+ # "address": "123 Mass Ave."
231
+ # },
232
+ # "bank_account_attributes": {
233
+ # "bank_name": "Best Bank",
234
+ # "bank_routing_number": "021000089",
235
+ # "bank_account_number": "111111111111",
236
+ # "bank_account_type": "checking",
237
+ # "bank_account_holder_type": "business",
238
+ # "payment_type": "bank_account"
239
+ # }
240
+ # }
241
+ # }
242
+ # ```
243
+ # ## Subscription with PayPal payment profile
244
+ # ### With the nonce from Braintree JS
245
+ # ```json
246
+ # { "subscription": {
247
+ # "product_handle":"test-product-b",
248
+ # "customer_attributes": {
249
+ # "first_name":"Amelia",
250
+ # "last_name":"Johnson",
251
+ # "email":"amelia@example.com",
252
+ # "organization":"My Awesome Company"
253
+ # },
254
+ # "payment_profile_attributes":{
255
+ # "paypal_email": "amelia@example.com",
256
+ # "current_vault": "braintree_blue",
257
+ # "payment_method_nonce":"abc123",
258
+ # "payment_type":"paypal_account"
259
+ # }
260
+ # }
261
+ # ```
262
+ # ### With the Braintree Customer ID as the vault token:
263
+ # ```json
264
+ # { "subscription": {
265
+ # "product_handle":"test-product-b",
266
+ # "customer_attributes": {
267
+ # "first_name":"Amelia",
268
+ # "last_name":"Johnson",
269
+ # "email":"amelia@example.com",
270
+ # "organization":"My Awesome Company"
271
+ # },
272
+ # "payment_profile_attributes":{
273
+ # "paypal_email": "amelia@example.com",
274
+ # "current_vault": "braintree_blue",
275
+ # "vault_token":"58271347",
276
+ # "payment_type":"paypal_account"
277
+ # }
278
+ # }
279
+ # ```
280
+ # ## Subscription using GoCardless Bank Number
281
+ # These examples creates a customer, bank account and mandate in GoCardless.
282
+ # For more information on GoCardless, please view the following two
283
+ # resources:
284
+ # + [Payment Profiles via API for
285
+ # GoCardless](https://developers.chargify.com/docs/api-docs/1f10a4f170405-cr
286
+ # eate-payment-profile#gocardless)
287
+ # + [Full documentation on
288
+ # GoCardless](https://maxio-chargify.zendesk.com/hc/en-us/articles/540450188
289
+ # 9677)
290
+ # + [Using Chargify.js with GoCardless - minimal
291
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
292
+ # DIy-examples#minimal-example-with-direct-debit-gocardless-gateway)
293
+ # + [Using Chargify.js with GoCardless - full
294
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
295
+ # DIy-examples#full-example-with-direct-debit-gocardless-gateway)
296
+ # ```json
297
+ # {
298
+ # "subscription": {
299
+ # "product_handle": "gold-product",
300
+ # "customer_attributes": {
301
+ # "first_name": "Jane",
302
+ # "last_name": "Doe",
303
+ # "email": "jd@chargify.test"
304
+ # },
305
+ # "bank_account_attributes": {
306
+ # "bank_name": "Royal Bank of France",
307
+ # "bank_account_number": "0000000",
308
+ # "bank_routing_number": "0003",
309
+ # "bank_branch_code": "00006",
310
+ # "payment_type": "bank_account",
311
+ # "billing_address": "20 Place de la Gare",
312
+ # "billing_city": "Colombes",
313
+ # "billing_state": "Île-de-France",
314
+ # "billing_zip": "92700",
315
+ # "billing_country": "FR"
316
+ # }
317
+ # }
318
+ # }
319
+ # ```
320
+ # ## Subscription using GoCardless IBAN Number
321
+ # ```json
322
+ # {
323
+ # "subscription": {
324
+ # "product_handle": "gold-product",
325
+ # "customer_attributes": {
326
+ # "first_name": "Jane",
327
+ # "last_name": "Doe",
328
+ # "email": "jd@chargify.test"
329
+ # },
330
+ # "bank_account_attributes": {
331
+ # "bank_name": "French Bank",
332
+ # "bank_iban": "FR1420041010050500013M02606",
333
+ # "payment_type": "bank_account",
334
+ # "billing_address": "20 Place de la Gare",
335
+ # "billing_city": "Colombes",
336
+ # "billing_state": "Île-de-France",
337
+ # "billing_zip": "92700",
338
+ # "billing_country": "FR"
339
+ # }
340
+ # }
341
+ # }
342
+ # ```
343
+ # ## Subscription using Stripe SEPA Direct Debit
344
+ # For more information on Stripe Direct Debit, please view the following two
345
+ # resources:
346
+ # + [Payment Profiles via API for Stripe SEPA Direct
347
+ # Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-
348
+ # payment-profile#sepa-direct-debit)
349
+ # + [Full documentation on Stripe Direct
350
+ # Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-
351
+ # Stripe-SEPA-and-BECS-Direct-Debit)
352
+ # + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal
353
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
354
+ # DIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway
355
+ # )
356
+ # + [Using Chargify.js with Stripe SEPA Direct Debit - full
357
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
358
+ # DIy-examples#full-example-with-sepa-direct-debit-stripe-gateway)
359
+ # ```json
360
+ # {
361
+ # "subscription": {
362
+ # "product_handle": "gold-product",
363
+ # "customer_attributes": {
364
+ # "first_name": "Jane",
365
+ # "last_name": "Doe",
366
+ # "email": "jd@chargify.test"
367
+ # },
368
+ # "bank_account_attributes": {
369
+ # "bank_name": "Test Bank",
370
+ # "bank_iban": "DE89370400440532013000",
371
+ # "payment_type": "bank_account"
372
+ # }
373
+ # }
374
+ # }
375
+ # ```
376
+ # ## Subscription using Stripe BECS Direct Debit
377
+ # For more information on Stripe Direct Debit, please view the following two
378
+ # resources:
379
+ # + [Payment Profiles via API for Stripe BECS Direct
380
+ # Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-
381
+ # payment-profile#stripe-becs-direct-debit)
382
+ # + [Full documentation on Stripe Direct
383
+ # Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-
384
+ # Stripe-SEPA-and-BECS-Direct-Debit)
385
+ # + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal
386
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
387
+ # DIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway
388
+ # )
389
+ # + [Using Chargify.js with Stripe BECS Direct Debit - full
390
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
391
+ # DIy-examples#full-example-with-becs-direct-debit-stripe-gateway)
392
+ # ```json
393
+ # {
394
+ # "subscription": {
395
+ # "product_handle": "gold-product",
396
+ # "customer_attributes": {
397
+ # "first_name": "Jane",
398
+ # "last_name": "Doe",
399
+ # "email": "jd@chargify.test"
400
+ # },
401
+ # "bank_account_attributes": {
402
+ # "bank_name": "Test Bank",
403
+ # "bank_branch_code": "000000",
404
+ # "bank_account_number": "000123456",
405
+ # "payment_type": "bank_account"
406
+ # }
407
+ # }
408
+ # }
409
+ # ```
410
+ # ## 3D Secure - Stripe
411
+ # It may happen that a payment needs 3D Secure Authentication when the
412
+ # subscription is created; this is referred to in our help docs as a
413
+ # [post-authentication
414
+ # flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#p
415
+ # sd2-flows-pre-authentication-and-post-authentication). The server returns
416
+ # `422 Unprocessable Entity` in this case with the following response:
417
+ # ```json
418
+ # {
419
+ # "errors": [
420
+ # "Your card was declined. This transaction requires 3D secure
421
+ # authentication."
422
+ # ],
423
+ # "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh",
424
+ # "description": "This card requires 3D secure authentication. Redirect
425
+ # the customer to the URL from the action_link attribute to authenticate.
426
+ # Attach callback_url param to this URL if you want to be notified about the
427
+ # result of 3D Secure authentication. Attach redirect_url param to this URL
428
+ # if you want to redirect a customer back to your page after 3D Secure
429
+ # authentication. Example:
430
+ # https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time
431
+ # _token_id=128&callback_url=https://localhost:4000&redirect_url=https://you
432
+ # rpage.com will do a POST request to https://localhost:4000 after payment
433
+ # is authenticated and will redirect a customer to https://yourpage.com
434
+ # after 3DS authentication.",
435
+ # "action_link":
436
+ # "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_t
437
+ # oken_id=242"
438
+ # }
439
+ # ```
440
+ # To let the customer go through 3D Secure Authentication, they need to be
441
+ # redirected to the URL specified in `action_link`.
442
+ # Optionally, you can specify `callback_url` parameter in the `action_link`
443
+ # URL if you’d like to be notified about the result of 3D Secure
444
+ # Authentication. The `callback_url` will return the following information:
445
+ # - whether the authentication was successful (`success`)
446
+ # - the gateway ID for the payment (`gateway_payment_id`)
447
+ # - the subscription ID (`subscription_id`)
448
+ # Lastly, you can also specify a `redirect_url` within the `action_link` URL
449
+ # if you’d like to redirect a customer back to your site.
450
+ # It is not possible to use `action_link` in an iframe inside a custom
451
+ # application. You have to redirect the customer directly to the
452
+ # `action_link`, then, to be notified about the result, use `redirect_url`
453
+ # or `callback_url`.
454
+ # The final URL that you send a customer to to complete 3D Secure may
455
+ # resemble the following, where the first half is the `action_link` and the
456
+ # second half contains a `redirect_url` and `callback_url`:
457
+ # `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_tim
458
+ # e_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yo
459
+ # urpage.com`
460
+ # ## 3D Secure - Checkout
461
+ # It may happen that a payment needs 3D Secure Authentication when the
462
+ # subscription is created; this is referred to in our help docs as a
463
+ # [post-authentication
464
+ # flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#p
465
+ # sd2-flows-pre-authentication-and-post-authentication). The server returns
466
+ # `422 Unprocessable Entity` in this case with the following response:
467
+ # ```json
468
+ # {
469
+ # "errors": [
470
+ # "Your card was declined. This transaction requires 3D secure
471
+ # authentication."
472
+ # ],
473
+ # "gateway_payment_id": "pay_6gjofv7dlyrkpizlolsuspvtiu",
474
+ # "description": "This card requires 3D secure authentication. Redirect
475
+ # the customer to the URL from the action_link attribute to authenticate.
476
+ # Attach callback_url param to this URL if you want to be notified about the
477
+ # result of 3D Secure authentication. Attach redirect_url param to this URL
478
+ # if you want to redirect a customer back to your page after 3D Secure
479
+ # authentication. Example:
480
+ # https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_t
481
+ # ime_token_id=123&callback_url=https://localhost:4000&redirect_url=https://
482
+ # yourpage.com will do a POST request to https://localhost:4000 after
483
+ # payment is authenticated and will redirect a customer to
484
+ # https://yourpage.com after 3DS authentication.",
485
+ # "action_link":
486
+ # "http://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_t
487
+ # ime_token_id=123"
488
+ # }
489
+ # ```
490
+ # To let the customer go through 3D Secure Authentication, they need to be
491
+ # redirected to the URL specified in `action_link`.
492
+ # Optionally, you can specify `callback_url` parameter in the `action_link`
493
+ # URL if you’d like to be notified about the result of 3D Secure
494
+ # Authentication. The `callback_url` will return the following information:
495
+ # - whether the authentication was successful (`success`)
496
+ # - the gateway ID for the payment (`gateway_payment_id`)
497
+ # - the subscription ID (`subscription_id`)
498
+ # Lastly, you can also specify a `redirect_url` parameter within the
499
+ # `action_link` URL if you’d like to redirect a customer back to your site.
500
+ # It is not possible to use `action_link` in an iframe inside a custom
501
+ # application. You have to redirect the customer directly to the
502
+ # `action_link`, then, to be notified about the result, use `redirect_url`
503
+ # or `callback_url`.
504
+ # The final URL that you send a customer to complete 3D Secure may resemble
505
+ # the following, where the first half is the `action_link` and the second
506
+ # half contains a `redirect_url` and `callback_url`:
507
+ # `https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_
508
+ # time_token_id=123&callback_url=https://localhost:4000&redirect_url=https:/
509
+ # /yourpage.com`
510
+ # ### Example Redirect Flow
511
+ # You may wish to redirect customers to different pages depending on whether
512
+ # their SCA was performed successfully. Here's an example flow to use as a
513
+ # reference:
514
+ # 1. Create a subscription via API; it requires 3DS
515
+ # 2. You receive a `gateway_payment_id` in the `action_link` along other
516
+ # params in the response.
517
+ # 3. Use this `gateway_payment_id` to, for example, connect with your
518
+ # internal resources or generate a session_id
519
+ # 4. Include 1 of those attributes inside the `callback_url` and
520
+ # `redirect_url` to be aware which “session” this applies to
521
+ # 5. Redirect the customer to the `action_link` with `callback_url` and
522
+ # `redirect_url` applied
523
+ # 6. After the customer finishes 3DS authentication, we let you know the
524
+ # result by making a request to applied `callback_url`.
525
+ # 7. After that, we redirect the customer to the `redirect_url`; at this
526
+ # point the result of authentication is known
527
+ # 8. Optionally, you can use the applied "msg" param in the `redirect_url`
528
+ # to determine whether it was successful or not
529
+ # ## Subscriptions Import
530
+ # Subscriptions can be “imported” via the API to handle the following
531
+ # scenarios:
532
+ # + You already have existing subscriptions with specific start and renewal
533
+ # dates that you would like to import to Chargify
534
+ # + You already have credit cards stored in your provider’s vault and you
535
+ # would like to create subscriptions using those tokens
536
+ # Before importing, you should have already set up your products to match
537
+ # your offerings. Then, you can create Subscriptions via the API just like
538
+ # you normally would, but using a few special attributes.
539
+ # Full documentation on how import Subscriptions using the **import tool**
540
+ # in the Chargify UI can be located
541
+ # [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#
542
+ # imports-0-0).
543
+ # ### Important Notices and Disclaimers regarding Imports
544
+ # Before performing a bulk import of subscriptions via the API, we suggest
545
+ # reading the [Subscriptions
546
+ # Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821
547
+ # #important-notices-and-disclaimers) instructions to understand the
548
+ # repurcussions of a large import.
549
+ # ### Subscription Input Attributes
550
+ # The following _additional_ attributes to the subscription input attributes
551
+ # make imports possible: `next_billing_at`, `previous_billing_at`, and
552
+ # `import_mrr`.
553
+ # ### Current Vault
554
+ # If you are using a Legacy gateway such as "eWAY Rapid (Legacy)" or "Stripe
555
+ # (Legacy)" then please contact Support for further instructions on
556
+ # subscription imports.
557
+ # ### Braintree Blue (Braintree v2) Imports
558
+ # Braintree Blue is Braintree’s newer (version 2) API. For this gateway,
559
+ # please provide the `vault_token` parameter with the value from Braintree’s
560
+ # “Customer ID” rather than the “Payment Profile Token”. At this time we do
561
+ # not use `current_vault_token` with the Braintree Blue gateway, and we only
562
+ # support a single payment profile per Braintree Customer.
563
+ # When importing PayPal type payment profiles, please set `payment_type` to
564
+ # `paypal_account`.
565
+ # ### Stripe ACH Imports
566
+ # If the bank account has already been verified, currently you will need to
567
+ # create the customer, create the payment profile in Chargify - setting
568
+ # verified=true, then create a subscription using the customer_id and
569
+ # payment_profile_id.
570
+ # ### Webhooks During Import
571
+ # If no `next_billing_at` is provided, webhooks will be fired as normal. If
572
+ # you do set a future `next_billing_at`, only a subset of the webhooks are
573
+ # fired when the subscription is created. Keep reading for more information
574
+ # as to what webhooks will be fired under which scenarios.
575
+ # #### Successful creation with Billing Date
576
+ # Scenario: If `next_billing_at` provided
577
+ # + `signup_success`
578
+ # + `billing_date_change`
579
+ # #### Successful creation without Billing Date
580
+ # Scenario: If no `next_billing_at` provided
581
+ # + `signup_success`
582
+ # + `payment_success`
583
+ # #### Unsuccessful creation
584
+ # Scenario: If card can’t be charged, and no `next_billing_at` provided
585
+ # + signup_failure
586
+ # #### Webhooks fired when next_billing_at is reached:
587
+ # + `renewal_success or renewal_failure`
588
+ # + `payment_success or payment_failure`
589
+ # ### Date and Time Formats
590
+ # We will attempt to parse any string you send as the value of
591
+ # next_billing_at in to a date or time. For best results, use a known format
592
+ # like described in “Date and Time Specification” of RFC 2822 or ISO 8601 .
593
+ # The following are all equivalent and will work as input to
594
+ # `next_billing_at`:
595
+ # ```
596
+ # Aug 06 2030 11:34:00 -0400
597
+ # Aug 06 2030 11:34 -0400
598
+ # 2030-08-06T11:34:00-04:00
599
+ # 8/6/2030 11:34:00 EDT
600
+ # 8/6/2030 8:34:00 PDT
601
+ # 2030-08-06T15:34:00Z
602
+ # ```
603
+ # You may also pass just a date, in which case we will assume the time to be
604
+ # noon
605
+ # ```
606
+ # 2010-08-06
607
+ # ```
608
+ # ## Subscription Hierarchies & WhoPays
609
+ # When subscription groups were first added to our Relationship Invoicing
610
+ # architecture, to group together invoices for related subscriptions and
611
+ # allow for complex customer hierarchies and WhoPays scenarios, they were
612
+ # designed to consist of a primary and a collection of group members. The
613
+ # primary would control many aspects of the group, such as when the
614
+ # consolidated invoice is generated. As of today, groups still function this
615
+ # way.
616
+ # In the future, the concept of a "primary" will be removed in order to
617
+ # offer more flexibility into group management and reduce confusion
618
+ # concerning what actions must be done on a primary level, rather than a
619
+ # member level.
620
+ # We have introduced a two scheme system as a bridge between these two group
621
+ # organizations. Scheme 1, which is relevant to all subscription groups
622
+ # today, marks the group as being "ruled" by a primary.
623
+ # When reading a subscription via API, they will return a top-level
624
+ # attribute called `group`, which will denote which scheme is being used. At
625
+ # this time, the `scheme` attribute will always be 1.
626
+ # ### Subscription in a Customer Hierarchy
627
+ # For sites making use of the [Relationship
628
+ # Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/540507879425
629
+ # 3-Introduction-to-Invoices) and [Customer
630
+ # Hierarchy](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404900384
631
+ # 141) features, it is possible to create subscriptions within a customer
632
+ # hierarchy. This can be achieved through the API by passing group
633
+ # parameters in the **Create Subscription** request.
634
+ # + The `group` parameters are optional and consist of the required `target`
635
+ # and optional `billing` parameters.
636
+ # When the `target` parameter specifies a customer that is already part of a
637
+ # hierarchy, the new subscription will become a member of the customer
638
+ # hierarchy as well. If the target customer is not part of a hierarchy, a
639
+ # new customer hierarchy will be created and both the target customer and
640
+ # the new subscription will become part of the hierarchy with the specified
641
+ # target customer set as the responsible payer for the hierarchy's
642
+ # subscriptions.
643
+ # Rather than specifying a customer, the `target` parameter could instead
644
+ # simply have a value of `self` which indicates the subscription will be
645
+ # paid for not by some other customer, but by the subscribing customer.
646
+ # This will be true whether the customer is being created new, is already
647
+ # part of a hierarchy, or already exists outside a hierarchy. A valid
648
+ # payment method must also be specified in the subscription parameters.
649
+ # Note that when creating subscriptions in a customer hierarchy, if the
650
+ # customer hierarchy does not already have a payment method, passing valid
651
+ # credit card attributes in the subscription parameters will also result in
652
+ # the payment method being established as the default payment method for the
653
+ # customer hierarchy irrespective of the responsible payer.
654
+ # The optional `billing` parameters specify how some aspects of the billing
655
+ # for the new subscription should be handled. Rather than capturing payment
656
+ # immediately, the `accrue` parameter can be included so that the new
657
+ # subscription charges accrue until the next assessment date. Regarding the
658
+ # date, the `align_date` parameter can be included so that the billing date
659
+ # of the new subscription matches up with the default subscription group in
660
+ # the customer hierarchy. When choosing to align the dates, the `prorate`
661
+ # parameter can also be specified so that the new subscription charges are
662
+ # prorated based on the billing period of the default subscription group in
663
+ # the customer hierarchy also.
664
+ # ### Subscription in a Subscription Group
665
+ # For sites making use of [Relationship
666
+ # Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/540507879425
667
+ # 3-Introduction-to-Invoices) it may be desireable to create a subscription
668
+ # as part of a [subscription
669
+ # group](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577356173)
670
+ # in order to rely on [invoice
671
+ # consolidation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540498
672
+ # 0119949). This can be achieved through the API by passing group parameters
673
+ # in the Create Subscription request. The `group` parameters are optional
674
+ # and consist of the required `target` and optional `billing` parameters.
675
+ # The `target` parameters specify an existing subscription with which the
676
+ # newly created subscription should be grouped. If the target subscription
677
+ # is already part of a group, the new subscription will become a member of
678
+ # the group as well. If the target subscription is not part of a group, a
679
+ # new group will be created and both the target and the new subscription
680
+ # will become part of the group with the target as the group's primary
681
+ # subscription.
682
+ # The optional `billing` parameters specify how some aspects of the billing
683
+ # for the new subscription should be handled. Rather than capturing payment
684
+ # immediately, the `accrue` parameter can be included so that the new
685
+ # subscription charges accrue until the next assessment date. Regarding the
686
+ # date, the `align_date` parameter can be included so that the billing date
687
+ # of the new subscription matches up with the target subscription. When
688
+ # choosing to align the dates, the `prorate` parameter can also be specified
689
+ # so that the new subscription charges are prorated based on the billing
690
+ # period of the target subscription also.
691
+ # ## Providing Agreement Acceptance Params
692
+ # It is possible to provide a proof of customer's acceptance of terms and
693
+ # policies.
694
+ # We will be storing this proof in case it might be required (i.e.
695
+ # chargeback).
696
+ # Currently, we already keep it for subscriptions created via Public Signup
697
+ # Pages.
698
+ # In order to create a subscription with the proof of agreement acceptance,
699
+ # you must provide additional parameters `agreement acceptance` with
700
+ # `ip_address` and at least one url to the policy that was accepted:
701
+ # `terms_url` or `privacy_policy_url`. Additional urls that can be provided:
702
+ # `return_refund_policy_url`, `delivery_policy_url` and
703
+ # `secure_checkout_policy_url`.
704
+ # ```json
705
+ # "subscription": {
706
+ # "product_handle": "gold-product",
707
+ # "customer_attributes": {
708
+ # "first_name": "Jane",
709
+ # "last_name": "Doe",
710
+ # "email": "jd@chargify.test"
711
+ # },
712
+ # "agreement_acceptance": {
713
+ # "ip_address": "1.2.3.4",
714
+ # "terms_url": "https://terms.url",
715
+ # "privacy_policy_url": "https://privacy_policy.url",
716
+ # "return_refund_policy_url": "https://return_refund_policy.url",
717
+ # "delivery_policy_url": "https://delivery_policy.url",
718
+ # "secure_checkout_policy_url": "https://secure_checkout_policy.url"
719
+ # }
720
+ # }
721
+ # }
722
+ # ```
723
+ # **For Maxio Payments subscriptions, the agreement acceptance params are
724
+ # required, with at least terms_url provided.**
725
+ # ## Providing ACH Agreement params
726
+ # It is also possible to provide a proof that a customer authorized ACH
727
+ # agreement terms.
728
+ # The proof will be stored and the email will be sent to the customer with a
729
+ # copy of the terms (if enabled).
730
+ # In order to create a subscription with the proof of authorized ACH
731
+ # agreement terms, you must provide the additional parameter `ach_agreement`
732
+ # with the following nested parameters: `agreement_terms`,
733
+ # `authorizer_first_name`, `authorizer_last_name` and `ip_address`.
734
+ # Each of them is required.
735
+ # ```json
736
+ # "subscription": {
737
+ # "product_handle": "gold-product",
738
+ # "customer_attributes": {
739
+ # "first_name": "Jane",
740
+ # "last_name": "Doe",
741
+ # "email": "jd@chargify.test"
742
+ # },
743
+ # "bank_account_attributes": {
744
+ # "bank_name": "Test Bank",
745
+ # "bank_routing_number": "021000089",
746
+ # "bank_account_number": "111111111111",
747
+ # "bank_account_type": "checking",
748
+ # "bank_account_holder_type": "business",
749
+ # "payment_type": "bank_account"
750
+ # },
751
+ # "ach_agreement": {
752
+ # "agreement_terms": "ACH agreement terms",
753
+ # "authorizer_first_name": "Jane",
754
+ # "authorizer_last_name": "Doe",
755
+ # "ip_address": "1.2.3.4"
756
+ # }
757
+ # }
758
+ # ```
759
+ # @param [CreateSubscriptionRequest] body Optional parameter: Example:
760
+ # @return [SubscriptionResponse] response from the API call
761
+ def create_subscription(body: nil)
762
+ new_api_call_builder
763
+ .request(new_request_builder(HttpMethodEnum::POST,
764
+ '/subscriptions.json',
765
+ Server::DEFAULT)
766
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
767
+ .body_param(new_parameter(body))
768
+ .header_param(new_parameter('application/json', key: 'accept'))
769
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
770
+ .auth(Single.new('global')))
771
+ .response(new_response_handler
772
+ .deserializer(APIHelper.method(:custom_type_deserializer))
773
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
774
+ .local_error_template('422',
775
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
776
+ ' Response: \'{$response.body}\'.',
777
+ ErrorListResponseException))
778
+ .execute
779
+ end
780
+
781
+ # This method will return an array of subscriptions from a Site. Pay close
782
+ # attention to query string filters and pagination in order to control
783
+ # responses from the server.
784
+ # ## Search for a subscription
785
+ # Use the query strings below to search for a subscription using the
786
+ # criteria available. The return value will be an array.
787
+ # ## Self-Service Page token
788
+ # Self-Service Page token for the subscriptions is not returned by default.
789
+ # If this information is desired, the include[]=self_service_page_token
790
+ # parameter must be provided with the request.
791
+ # @param [Integer] page Optional parameter: Result records are organized in
792
+ # pages. By default, the first page of results is displayed. The page
793
+ # parameter specifies a page number of results to fetch. You can start
794
+ # navigating through the pages to consume the results. You do this by
795
+ # passing in a page parameter. Retrieve the next page by adding ?page=2 to
796
+ # the query string. If there are no results to return, then an empty result
797
+ # set will be returned. Use in query `page=1`.
798
+ # @param [Integer] per_page Optional parameter: This parameter indicates how
799
+ # many records to fetch in each request. Default value is 20. The maximum
800
+ # allowed values is 200; any per_page value over 200 will be changed to 200.
801
+ # Use in query `per_page=200`.
802
+ # @param [SubscriptionStateFilter] state Optional parameter: The current
803
+ # state of the subscription
804
+ # @param [Integer] product Optional parameter: The product id of the
805
+ # subscription. (Note that the product handle cannot be used.)
806
+ # @param [Integer] product_price_point_id Optional parameter: The ID of the
807
+ # product price point. If supplied, product is required
808
+ # @param [Integer] coupon Optional parameter: The numeric id of the coupon
809
+ # currently applied to the subscription. (This can be found in the URL when
810
+ # editing a coupon. Note that the coupon code cannot be used.)
811
+ # @param [SubscriptionDateField] date_field Optional parameter: The type of
812
+ # filter you'd like to apply to your search. Allowed Values: ,
813
+ # current_period_ends_at, current_period_starts_at, created_at,
814
+ # activated_at, canceled_at, expires_at, trial_started_at, trial_ended_at,
815
+ # updated_at
816
+ # @param [Date] start_date Optional parameter: The start date (format
817
+ # YYYY-MM-DD) with which to filter the date_field. Returns subscriptions
818
+ # with a timestamp at or after midnight (12:00:00 AM) in your site’s time
819
+ # zone on the date specified. Use in query `start_date=2022-07-01`.
820
+ # @param [Date] end_date Optional parameter: The end date (format
821
+ # YYYY-MM-DD) with which to filter the date_field. Returns subscriptions
822
+ # with a timestamp up to and including 11:59:59PM in your site’s time zone
823
+ # on the date specified. Use in query `end_date=2022-08-01`.
824
+ # @param [DateTime] start_datetime Optional parameter: The start date and
825
+ # time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field.
826
+ # Returns subscriptions with a timestamp at or after exact time provided in
827
+ # query. You can specify timezone in query - otherwise your site's time zone
828
+ # will be used. If provided, this parameter will be used instead of
829
+ # start_date. Use in query `start_datetime=2022-07-01 09:00:05`.
830
+ # @param [DateTime] end_datetime Optional parameter: The end date and time
831
+ # (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns
832
+ # subscriptions with a timestamp at or before exact time provided in query.
833
+ # You can specify timezone in query - otherwise your site's time zone will
834
+ # be used. If provided, this parameter will be used instead of end_date. Use
835
+ # in query `end_datetime=2022-08-01 10:00:05`.
836
+ # @param [Hash[String, String]] metadata Optional parameter: The value of
837
+ # the metadata field specified in the parameter. Use in query
838
+ # `metadata[my-field]=value&metadata[other-field]=another_value`.
839
+ # @param [SortingDirection] direction Optional parameter: Controls the order
840
+ # in which results are returned. Use in query `direction=asc`.
841
+ # @param [SubscriptionSort] sort Optional parameter: The attribute by which
842
+ # to sort
843
+ # @param [Array[SubscriptionListInclude]] include Optional parameter: Allows
844
+ # including additional data in the response. Use in query:
845
+ # `include[]=self_service_page_token`.
846
+ # @return [Array[SubscriptionResponse]] response from the API call
847
+ def list_subscriptions(options = {})
848
+ new_api_call_builder
849
+ .request(new_request_builder(HttpMethodEnum::GET,
850
+ '/subscriptions.json',
851
+ Server::DEFAULT)
852
+ .query_param(new_parameter(options['page'], key: 'page'))
853
+ .query_param(new_parameter(options['per_page'], key: 'per_page'))
854
+ .query_param(new_parameter(options['state'], key: 'state'))
855
+ .query_param(new_parameter(options['product'], key: 'product'))
856
+ .query_param(new_parameter(options['product_price_point_id'], key: 'product_price_point_id'))
857
+ .query_param(new_parameter(options['coupon'], key: 'coupon'))
858
+ .query_param(new_parameter(options['date_field'], key: 'date_field'))
859
+ .query_param(new_parameter(options['start_date'], key: 'start_date'))
860
+ .query_param(new_parameter(options['end_date'], key: 'end_date'))
861
+ .query_param(new_parameter(options['start_datetime'], key: 'start_datetime'))
862
+ .query_param(new_parameter(options['end_datetime'], key: 'end_datetime'))
863
+ .query_param(new_parameter(options['metadata'], key: 'metadata'))
864
+ .query_param(new_parameter(options['direction'], key: 'direction'))
865
+ .query_param(new_parameter(options['sort'], key: 'sort'))
866
+ .query_param(new_parameter(options['include'], key: 'include[]'))
867
+ .header_param(new_parameter('application/json', key: 'accept'))
868
+ .auth(Single.new('global'))
869
+ .array_serialization_format(ArraySerializationFormat::CSV))
870
+ .response(new_response_handler
871
+ .deserializer(APIHelper.method(:custom_type_deserializer))
872
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
873
+ .is_response_array(true))
874
+ .execute
875
+ end
876
+
877
+ # The subscription endpoint allows you to instantly update one or many
878
+ # attributes about a subscription in a single call.
879
+ # ## Update Subscription Payment Method
880
+ # Change the card that your Subscriber uses for their subscription. You can
881
+ # also use this method to simply change the expiration date of the card **if
882
+ # your gateway allows**.
883
+ # Note that partial card updates for **Authorize.Net** are not allowed via
884
+ # this endpoint. The existing Payment Profile must be directly updated
885
+ # instead.
886
+ # You also use this method to change the subscription to a different product
887
+ # by setting a new value for product_handle. A product change can be done in
888
+ # two different ways, **product change** or **delayed product change**.
889
+ # ## Product Change
890
+ # This endpoint may be used to change a subscription's product. The new
891
+ # payment amount is calculated and charged at the normal start of the next
892
+ # period. If you desire complex product changes or prorated upgrades and
893
+ # downgrades instead, please see the documentation on Migrating Subscription
894
+ # Products.
895
+ # To perform a product change, simply set either the `product_handle` or
896
+ # `product_id` attribute to that of a different product from the same site
897
+ # as the subscription. You can also change the price point by passing in
898
+ # either `product_price_point_id` or `product_price_point_handle` -
899
+ # otherwise the new product's default price point will be used.
900
+ # ### Delayed Product Change
901
+ # This method also changes the product and/or price point, and the new
902
+ # payment amount is calculated and charged at the normal start of the next
903
+ # period.
904
+ # This method schedules the product change to happen automatically at the
905
+ # subscription’s next renewal date. To perform a Delayed Product Change, set
906
+ # the `product_handle` attribute as you would in a regular product change,
907
+ # but also set the `product_change_delayed` attribute to `true`. No
908
+ # proration applies in this case.
909
+ # You can also perform a delayed change to the price point by passing in
910
+ # either `product_price_point_id` or `product_price_point_handle`
911
+ # **Note: To cancel a delayed product change, set `next_product_id` to an
912
+ # empty string.**
913
+ # ## Billing Date Changes
914
+ # ### Regular Billing Date Changes
915
+ # Send the `next_billing_at` to set the next billing date for the
916
+ # subscription. After that date passes and the subscription is processed,
917
+ # the following billing date will be set according to the subscription's
918
+ # product period.
919
+ # Note that if you pass an invalid date, we will automatically interpret and
920
+ # set the correct date. For example, when February 30 is entered, the next
921
+ # billing will be set to March 2nd in a non-leap year.
922
+ # The server response will not return data under the key/value pair of
923
+ # `next_billing`. Please view the key/value pair of `current_period_ends_at`
924
+ # to verify that the `next_billing` date has been changed successfully.
925
+ # ### Snap Day Changes
926
+ # For a subscription using Calendar Billing, setting the next billing date
927
+ # is a bit different. Send the `snap_day` attribute to change the calendar
928
+ # billing date for **a subscription using a product eligible for calendar
929
+ # billing**.
930
+ # Note: If you change the product associated with a subscription that
931
+ # contains a `snap_date` and immediately `READ/GET` the subscription data,
932
+ # it will still contain evidence of the existing `snap_date`. This is due to
933
+ # the fact that a product change is instantanous and only affects the
934
+ # product associated with a subscription. After the `next_billing` date
935
+ # arrives, the `snap_day` associated with the subscription will return to
936
+ # `null.` Another way of looking at this is that you willl have to wait for
937
+ # the next billing cycle to arrive before the `snap_date` will reset to
938
+ # `null`.
939
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
940
+ # the subscription
941
+ # @param [UpdateSubscriptionRequest] body Optional parameter: Example:
942
+ # @return [SubscriptionResponse] response from the API call
943
+ def update_subscription(subscription_id,
944
+ body: nil)
945
+ new_api_call_builder
946
+ .request(new_request_builder(HttpMethodEnum::PUT,
947
+ '/subscriptions/{subscription_id}.json',
948
+ Server::DEFAULT)
949
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
950
+ .is_required(true)
951
+ .should_encode(true))
952
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
953
+ .body_param(new_parameter(body))
954
+ .header_param(new_parameter('application/json', key: 'accept'))
955
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
956
+ .auth(Single.new('global')))
957
+ .response(new_response_handler
958
+ .deserializer(APIHelper.method(:custom_type_deserializer))
959
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
960
+ .local_error_template('422',
961
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
962
+ ' Response: \'{$response.body}\'.',
963
+ ErrorListResponseException))
964
+ .execute
965
+ end
966
+
967
+ # Use this endpoint to find subscription details.
968
+ # ## Self-Service Page token
969
+ # Self-Service Page token for the subscription is not returned by default.
970
+ # If this information is desired, the include[]=self_service_page_token
971
+ # parameter must be provided with the request.
972
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
973
+ # the subscription
974
+ # @param [Array[SubscriptionInclude]] include Optional parameter: Allows
975
+ # including additional data in the response. Use in query:
976
+ # `include[]=coupons&include[]=self_service_page_token`.
977
+ # @return [SubscriptionResponse] response from the API call
978
+ def read_subscription(subscription_id,
979
+ include: nil)
980
+ new_api_call_builder
981
+ .request(new_request_builder(HttpMethodEnum::GET,
982
+ '/subscriptions/{subscription_id}.json',
983
+ Server::DEFAULT)
984
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
985
+ .is_required(true)
986
+ .should_encode(true))
987
+ .query_param(new_parameter(include, key: 'include[]'))
988
+ .header_param(new_parameter('application/json', key: 'accept'))
989
+ .auth(Single.new('global'))
990
+ .array_serialization_format(ArraySerializationFormat::PLAIN))
991
+ .response(new_response_handler
992
+ .deserializer(APIHelper.method(:custom_type_deserializer))
993
+ .deserialize_into(SubscriptionResponse.method(:from_hash)))
994
+ .execute
995
+ end
996
+
997
+ # This API endpoint allows you to set certain subscription fields that are
998
+ # usually managed for you automatically. Some of the fields can be set via
999
+ # the normal Subscriptions Update API, but others can only be set using this
1000
+ # endpoint.
1001
+ # This endpoint is provided for cases where you need to “align” Chargify
1002
+ # data with data that happened in your system, perhaps before you started
1003
+ # using Chargify. For example, you may choose to import your historical
1004
+ # subscription data, and would like the activation and cancellation dates in
1005
+ # Chargify to match your existing historical dates. Chargify does not
1006
+ # backfill historical events (i.e. from the Events API), but some static
1007
+ # data can be changed via this API.
1008
+ # Why are some fields only settable from this endpoint, and not the normal
1009
+ # subscription create and update endpoints? Because we want users of this
1010
+ # endpoint to be aware that these fields are usually managed by Chargify,
1011
+ # and using this API means **you are stepping out on your own.**
1012
+ # Changing these fields will not affect any other attributes. For example,
1013
+ # adding an expiration date will not affect the next assessment date on the
1014
+ # subscription.
1015
+ # If you regularly need to override the current_period_starts_at for new
1016
+ # subscriptions, this can also be accomplished by setting both
1017
+ # `previous_billing_at` and `next_billing_at` at subscription creation. See
1018
+ # the documentation on [Importing
1019
+ # Subscriptions](./b3A6MTQxMDgzODg-create-subscription#subscriptions-import)
1020
+ # for more information.
1021
+ # ## Limitations
1022
+ # When passing `current_period_starts_at` some validations are made:
1023
+ # 1. The subscription needs to be unbilled (no statements or invoices).
1024
+ # 2. The value passed must be a valid date/time. We recommend using the iso
1025
+ # 8601 format.
1026
+ # 3. The value passed must be before the current date/time.
1027
+ # If unpermitted parameters are sent, a 400 HTTP response is sent along with
1028
+ # a string giving the reason for the problem.
1029
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
1030
+ # the subscription
1031
+ # @param [OverrideSubscriptionRequest] body Optional parameter: Only these
1032
+ # fields are available to be set.
1033
+ # @return [void] response from the API call
1034
+ def override_subscription(subscription_id,
1035
+ body: nil)
1036
+ new_api_call_builder
1037
+ .request(new_request_builder(HttpMethodEnum::PUT,
1038
+ '/subscriptions/{subscription_id}/override.json',
1039
+ Server::DEFAULT)
1040
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1041
+ .is_required(true)
1042
+ .should_encode(true))
1043
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1044
+ .body_param(new_parameter(body))
1045
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1046
+ .auth(Single.new('global')))
1047
+ .response(new_response_handler
1048
+ .is_response_void(true)
1049
+ .local_error_template('422',
1050
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
1051
+ ' Response: \'{$response.body}\'.',
1052
+ SingleErrorResponseException))
1053
+ .execute
1054
+ end
1055
+
1056
+ # Use this endpoint to find a subscription by its reference.
1057
+ # @param [String] reference Optional parameter: Subscription reference
1058
+ # @return [SubscriptionResponse] response from the API call
1059
+ def read_subscription_by_reference(reference: nil)
1060
+ new_api_call_builder
1061
+ .request(new_request_builder(HttpMethodEnum::GET,
1062
+ '/subscriptions/lookup.json',
1063
+ Server::DEFAULT)
1064
+ .query_param(new_parameter(reference, key: 'reference'))
1065
+ .header_param(new_parameter('application/json', key: 'accept'))
1066
+ .auth(Single.new('global')))
1067
+ .response(new_response_handler
1068
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1069
+ .deserialize_into(SubscriptionResponse.method(:from_hash)))
1070
+ .execute
1071
+ end
1072
+
1073
+ # For sites in test mode, you may purge individual subscriptions.
1074
+ # Provide the subscription ID in the url. To confirm, supply the customer
1075
+ # ID in the query string `ack` parameter. You may also delete the customer
1076
+ # record and/or payment profiles by passing `cascade` parameters. For
1077
+ # example, to delete just the customer record, the query params would be:
1078
+ # `?ack={customer_id}&cascade[]=customer`
1079
+ # If you need to remove subscriptions from a live site, please contact
1080
+ # support to discuss your use case.
1081
+ # ### Delete customer and payment profile
1082
+ # The query params will be:
1083
+ # `?ack={customer_id}&cascade[]=customer&cascade[]=payment_profile`
1084
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
1085
+ # the subscription
1086
+ # @param [Integer] ack Required parameter: id of the customer.
1087
+ # @param [Array[SubscriptionPurgeType]] cascade Optional parameter: Options
1088
+ # are "customer" or "payment_profile". Use in query:
1089
+ # `cascade[]=customer&cascade[]=payment_profile`.
1090
+ # @return [void] response from the API call
1091
+ def purge_subscription(subscription_id,
1092
+ ack,
1093
+ cascade: nil)
1094
+ new_api_call_builder
1095
+ .request(new_request_builder(HttpMethodEnum::POST,
1096
+ '/subscriptions/{subscription_id}/purge.json',
1097
+ Server::DEFAULT)
1098
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1099
+ .is_required(true)
1100
+ .should_encode(true))
1101
+ .query_param(new_parameter(ack, key: 'ack')
1102
+ .is_required(true))
1103
+ .query_param(new_parameter(cascade, key: 'cascade[]'))
1104
+ .auth(Single.new('global'))
1105
+ .array_serialization_format(ArraySerializationFormat::PLAIN))
1106
+ .response(new_response_handler
1107
+ .is_response_void(true))
1108
+ .execute
1109
+ end
1110
+
1111
+ # Use this endpoint to update a subscription's prepaid configuration.
1112
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
1113
+ # the subscription
1114
+ # @param [UpsertPrepaidConfigurationRequest] body Optional parameter:
1115
+ # Example:
1116
+ # @return [PrepaidConfigurationResponse] response from the API call
1117
+ def create_prepaid_subscription(subscription_id,
1118
+ body: nil)
1119
+ new_api_call_builder
1120
+ .request(new_request_builder(HttpMethodEnum::POST,
1121
+ '/subscriptions/{subscription_id}/prepaid_configurations.json',
1122
+ Server::DEFAULT)
1123
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1124
+ .is_required(true)
1125
+ .should_encode(true))
1126
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1127
+ .body_param(new_parameter(body))
1128
+ .header_param(new_parameter('application/json', key: 'accept'))
1129
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1130
+ .auth(Single.new('global')))
1131
+ .response(new_response_handler
1132
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1133
+ .deserialize_into(PrepaidConfigurationResponse.method(:from_hash)))
1134
+ .execute
1135
+ end
1136
+
1137
+ # The Chargify API allows you to preview a subscription by POSTing the same
1138
+ # JSON or XML as for a subscription creation.
1139
+ # The "Next Billing" amount and "Next Billing" date are represented in each
1140
+ # Subscriber's Summary. For more information, please see our documentation
1141
+ # [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-b
1142
+ # illing).
1143
+ # ## Side effects
1144
+ # A subscription will not be created by sending a POST to this endpoint. It
1145
+ # is meant to serve as a prediction.
1146
+ # ## Taxable Subscriptions
1147
+ # This endpoint will preview taxes applicable to a purchase. In order for
1148
+ # taxes to be previewed, the following conditions must be met:
1149
+ # + Taxes must be configured on the subscription
1150
+ # + The preview must be for the purchase of a taxable product or component,
1151
+ # or combination of the two.
1152
+ # + The subscription payload must contain a full billing or shipping address
1153
+ # in order to calculate tax
1154
+ # For more information about creating taxable previews, please see our
1155
+ # documentation guide on how to create [taxable
1156
+ # subscriptions.](https://chargify.zendesk.com/hc/en-us/articles/44079042177
1157
+ # 55#creating-taxable-subscriptions)
1158
+ # You do **not** need to include a card number to generate tax information
1159
+ # when you are previewing a subscription. However, please note that when you
1160
+ # actually want to create the subscription, you must include the credit card
1161
+ # information if you want the billing address to be stored in Chargify. The
1162
+ # billing address and the credit card information are stored together within
1163
+ # the payment profile object. Also, you may not send a billing address to
1164
+ # Chargify without payment profile information, as the address is stored on
1165
+ # the card.
1166
+ # You can pass shipping and billing addresses and still decide not to
1167
+ # calculate taxes. To do that, pass `skip_billing_manifest_taxes: true`
1168
+ # attribute.
1169
+ # ## Non-taxable Subscriptions
1170
+ # If you'd like to calculate subscriptions that do not include tax, please
1171
+ # feel free to leave off the billing information.
1172
+ # @param [CreateSubscriptionRequest] body Optional parameter: Example:
1173
+ # @return [SubscriptionPreviewResponse] response from the API call
1174
+ def preview_subscription(body: nil)
1175
+ new_api_call_builder
1176
+ .request(new_request_builder(HttpMethodEnum::POST,
1177
+ '/subscriptions/preview.json',
1178
+ Server::DEFAULT)
1179
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1180
+ .body_param(new_parameter(body))
1181
+ .header_param(new_parameter('application/json', key: 'accept'))
1182
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1183
+ .auth(Single.new('global')))
1184
+ .response(new_response_handler
1185
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1186
+ .deserialize_into(SubscriptionPreviewResponse.method(:from_hash)))
1187
+ .execute
1188
+ end
1189
+
1190
+ # An existing subscription can accommodate multiple discounts/coupon codes.
1191
+ # This is only applicable if each coupon is stackable. For more information
1192
+ # on stackable coupons, we recommend reviewing our [coupon
1193
+ # documentation.](https://chargify.zendesk.com/hc/en-us/articles/44077559095
1194
+ # 31#stackable-coupons)
1195
+ # ## Query Parameters vs Request Body Parameters
1196
+ # Passing in a coupon code as a query parameter will add the code to the
1197
+ # subscription, completely replacing all existing coupon codes on the
1198
+ # subscription.
1199
+ # For this reason, using this query parameter on this endpoint has been
1200
+ # deprecated in favor of using the request body parameters as described
1201
+ # below. When passing in request body parameters, the list of coupon codes
1202
+ # will simply be added to any existing list of codes on the subscription.
1203
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
1204
+ # the subscription
1205
+ # @param [String] code Optional parameter: A code for the coupon that would
1206
+ # be applied to a subscription
1207
+ # @param [AddCouponsRequest] body Optional parameter: Example:
1208
+ # @return [SubscriptionResponse] response from the API call
1209
+ def apply_coupon_to_subscription(subscription_id,
1210
+ code: nil,
1211
+ body: nil)
1212
+ new_api_call_builder
1213
+ .request(new_request_builder(HttpMethodEnum::POST,
1214
+ '/subscriptions/{subscription_id}/add_coupon.json',
1215
+ Server::DEFAULT)
1216
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1217
+ .is_required(true)
1218
+ .should_encode(true))
1219
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1220
+ .query_param(new_parameter(code, key: 'code'))
1221
+ .body_param(new_parameter(body))
1222
+ .header_param(new_parameter('application/json', key: 'accept'))
1223
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1224
+ .auth(Single.new('global')))
1225
+ .response(new_response_handler
1226
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1227
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
1228
+ .local_error_template('422',
1229
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
1230
+ ' Response: \'{$response.body}\'.',
1231
+ SubscriptionAddCouponErrorException))
1232
+ .execute
1233
+ end
1234
+
1235
+ # Use this endpoint to remove a coupon from an existing subscription.
1236
+ # For more information on the expected behaviour of removing a coupon from a
1237
+ # subscription, please see our documentation
1238
+ # [here.](https://chargify.zendesk.com/hc/en-us/articles/4407896488987#remov
1239
+ # ing-a-coupon)
1240
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
1241
+ # the subscription
1242
+ # @param [String] coupon_code Optional parameter: The coupon code
1243
+ # @return [String] response from the API call
1244
+ def delete_coupon_from_subscription(subscription_id,
1245
+ coupon_code: nil)
1246
+ new_api_call_builder
1247
+ .request(new_request_builder(HttpMethodEnum::DELETE,
1248
+ '/subscriptions/{subscription_id}/remove_coupon.json',
1249
+ Server::DEFAULT)
1250
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1251
+ .is_required(true)
1252
+ .should_encode(true))
1253
+ .query_param(new_parameter(coupon_code, key: 'coupon_code'))
1254
+ .auth(Single.new('global')))
1255
+ .response(new_response_handler
1256
+ .deserializer(APIHelper.method(:deserialize_primitive_types))
1257
+ .deserialize_into(proc do |response| response.to_s end)
1258
+ .is_primitive_response(true)
1259
+ .local_error_template('422',
1260
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
1261
+ ' Response: \'{$response.body}\'.',
1262
+ SubscriptionRemoveCouponErrorsException))
1263
+ .execute
1264
+ end
1265
+
1266
+ # Chargify offers the ability to activate awaiting signup and trialing
1267
+ # subscriptions. This feature is only available on the Relationship
1268
+ # Invoicing architecture. Subscriptions in a group may not be activated
1269
+ # immediately.
1270
+ # For details on how the activation works, and how to activate subscriptions
1271
+ # through the application, see [activation](#).
1272
+ # The `revert_on_failure` parameter controls the behavior upon activation
1273
+ # failure.
1274
+ # - If set to `true` and something goes wrong i.e. payment fails, then
1275
+ # Chargify will not change the subscription's state. The subscription’s
1276
+ # billing period will also remain the same.
1277
+ # - If set to `false` and something goes wrong i.e. payment fails, then
1278
+ # Chargify will continue through with the activation and enter an end of
1279
+ # life state. For trialing subscriptions, that will either be trial ended
1280
+ # (if the trial is no obligation), past due (if the trial has an
1281
+ # obligation), or canceled (if the site has no dunning strategy, or has a
1282
+ # strategy that says to cancel immediately). For awaiting signup
1283
+ # subscriptions, that will always be canceled.
1284
+ # The default activation failure behavior can be configured per activation
1285
+ # attempt, or you may set a default value under Config > Settings >
1286
+ # Subscription Activation Settings.
1287
+ # ## Activation Scenarios
1288
+ # ### Activate Awaiting Signup subscription
1289
+ # - Given you have a product without trial
1290
+ # - Given you have a site without dunning strategy
1291
+ # ```mermaid
1292
+ # flowchart LR
1293
+ # AS[Awaiting Signup] --> A{Activate}
1294
+ # A -->|Success| Active
1295
+ # A -->|Failure| ROF{revert_on_failure}
1296
+ # ROF -->|true| AS
1297
+ # ROF -->|false| Canceled
1298
+ # ```
1299
+ # - Given you have a product with trial
1300
+ # - Given you have a site with dunning strategy
1301
+ # ```mermaid
1302
+ # flowchart LR
1303
+ # AS[Awaiting Signup] --> A{Activate}
1304
+ # A -->|Success| Trialing
1305
+ # A -->|Failure| ROF{revert_on_failure}
1306
+ # ROF -->|true| AS
1307
+ # ROF -->|false| PD[Past Due]
1308
+ # ```
1309
+ # ### Activate Trialing subscription
1310
+ # You can read more about the behavior of trialing subscriptions
1311
+ # [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404494617357#
1312
+ # trialing-subscriptions-0-0).
1313
+ # When the `revert_on_failure` parameter is set to `true`, the
1314
+ # subscription's state will remain as Trialing, we will void the invoice
1315
+ # from activation and return any prepayments and credits applied to the
1316
+ # invoice back to the subscription.
1317
+ # @param [Integer] subscription_id Required parameter: The Chargify id of
1318
+ # the subscription
1319
+ # @param [ActivateSubscriptionRequest] body Optional parameter: Example:
1320
+ # @return [SubscriptionResponse] response from the API call
1321
+ def activate_subscription(subscription_id,
1322
+ body: nil)
1323
+ new_api_call_builder
1324
+ .request(new_request_builder(HttpMethodEnum::PUT,
1325
+ '/subscriptions/{subscription_id}/activate.json',
1326
+ Server::DEFAULT)
1327
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1328
+ .is_required(true)
1329
+ .should_encode(true))
1330
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1331
+ .body_param(new_parameter(body))
1332
+ .header_param(new_parameter('application/json', key: 'accept'))
1333
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1334
+ .auth(Single.new('global')))
1335
+ .response(new_response_handler
1336
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1337
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
1338
+ .local_error_template('400',
1339
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
1340
+ ' Response: \'{$response.body}\'.',
1341
+ ErrorArrayMapResponseException))
1342
+ .execute
1343
+ end
1344
+ end
1345
+ end