maxio-advanced-billing-sdk 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (711) 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 +448 -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/address_change.rb +79 -0
  74. data/lib/advanced_billing/models/agreement_acceptance.rb +117 -0
  75. data/lib/advanced_billing/models/allocate_components.rb +151 -0
  76. data/lib/advanced_billing/models/allocation.rb +340 -0
  77. data/lib/advanced_billing/models/allocation_expiration_date.rb +50 -0
  78. data/lib/advanced_billing/models/allocation_preview.rb +197 -0
  79. data/lib/advanced_billing/models/allocation_preview_direction.rb +23 -0
  80. data/lib/advanced_billing/models/allocation_preview_item.rb +272 -0
  81. data/lib/advanced_billing/models/allocation_preview_line_item.rb +135 -0
  82. data/lib/advanced_billing/models/allocation_preview_line_item_kind.rb +29 -0
  83. data/lib/advanced_billing/models/allocation_preview_response.rb +49 -0
  84. data/lib/advanced_billing/models/allocation_response.rb +50 -0
  85. data/lib/advanced_billing/models/allocation_settings.rb +79 -0
  86. data/lib/advanced_billing/models/applied_credit_note_data.rb +60 -0
  87. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +198 -0
  88. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +111 -0
  89. data/lib/advanced_billing/models/apply_payment_event_data.rb +198 -0
  90. data/lib/advanced_billing/models/attribute_error.rb +48 -0
  91. data/lib/advanced_billing/models/auto_invite.rb +23 -0
  92. data/lib/advanced_billing/models/auto_resume.rb +61 -0
  93. data/lib/advanced_billing/models/bank_account_attributes.rb +175 -0
  94. data/lib/advanced_billing/models/bank_account_holder_type.rb +23 -0
  95. data/lib/advanced_billing/models/bank_account_payment_profile.rb +310 -0
  96. data/lib/advanced_billing/models/bank_account_response.rb +49 -0
  97. data/lib/advanced_billing/models/bank_account_type.rb +23 -0
  98. data/lib/advanced_billing/models/bank_account_vault.rb +32 -0
  99. data/lib/advanced_billing/models/bank_account_verification.rb +62 -0
  100. data/lib/advanced_billing/models/bank_account_verification_request.rb +50 -0
  101. data/lib/advanced_billing/models/base_model.rb +62 -0
  102. data/lib/advanced_billing/models/base_refund_error.rb +50 -0
  103. data/lib/advanced_billing/models/base_string_error.rb +50 -0
  104. data/lib/advanced_billing/models/basic_date_field.rb +23 -0
  105. data/lib/advanced_billing/models/batch_job.rb +94 -0
  106. data/lib/advanced_billing/models/batch_job_response.rb +48 -0
  107. data/lib/advanced_billing/models/billing_address.rb +107 -0
  108. data/lib/advanced_billing/models/billing_manifest.rb +147 -0
  109. data/lib/advanced_billing/models/billing_manifest_item.rb +189 -0
  110. data/lib/advanced_billing/models/billing_manifest_line_item_kind.rb +35 -0
  111. data/lib/advanced_billing/models/billing_schedule.rb +55 -0
  112. data/lib/advanced_billing/models/breakouts.rb +84 -0
  113. data/lib/advanced_billing/models/bulk_component_s_price_point_assignment.rb +59 -0
  114. data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +57 -0
  115. data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +59 -0
  116. data/lib/advanced_billing/models/bulk_create_segments.rb +59 -0
  117. data/lib/advanced_billing/models/bulk_update_segments.rb +59 -0
  118. data/lib/advanced_billing/models/bulk_update_segments_item.rb +80 -0
  119. data/lib/advanced_billing/models/calendar_billing.rb +79 -0
  120. data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +51 -0
  121. data/lib/advanced_billing/models/cancellation_method.rb +33 -0
  122. data/lib/advanced_billing/models/cancellation_options.rb +63 -0
  123. data/lib/advanced_billing/models/cancellation_request.rb +48 -0
  124. data/lib/advanced_billing/models/card_type.rb +125 -0
  125. data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +81 -0
  126. data/lib/advanced_billing/models/chargify_ebb.rb +116 -0
  127. data/lib/advanced_billing/models/cleanup_scope.rb +26 -0
  128. data/lib/advanced_billing/models/collection_method.rb +32 -0
  129. data/lib/advanced_billing/models/component.rb +495 -0
  130. data/lib/advanced_billing/models/component_allocation_change.rb +147 -0
  131. data/lib/advanced_billing/models/component_allocation_error_item.rb +80 -0
  132. data/lib/advanced_billing/models/component_cost_data.rb +128 -0
  133. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +94 -0
  134. data/lib/advanced_billing/models/component_currency_price.rb +102 -0
  135. data/lib/advanced_billing/models/component_currency_prices_response.rb +57 -0
  136. data/lib/advanced_billing/models/component_custom_price.rb +96 -0
  137. data/lib/advanced_billing/models/component_kind.rb +32 -0
  138. data/lib/advanced_billing/models/component_price.rb +127 -0
  139. data/lib/advanced_billing/models/component_price_point.rb +304 -0
  140. data/lib/advanced_billing/models/component_price_point_error_item.rb +70 -0
  141. data/lib/advanced_billing/models/component_price_point_item.rb +119 -0
  142. data/lib/advanced_billing/models/component_price_point_response.rb +48 -0
  143. data/lib/advanced_billing/models/component_price_points_response.rb +69 -0
  144. data/lib/advanced_billing/models/component_response.rb +48 -0
  145. data/lib/advanced_billing/models/component_s_price_point_assignment.rb +72 -0
  146. data/lib/advanced_billing/models/compounding_strategy.rb +23 -0
  147. data/lib/advanced_billing/models/consolidated_invoice.rb +59 -0
  148. data/lib/advanced_billing/models/count_response.rb +50 -0
  149. data/lib/advanced_billing/models/coupon.rb +384 -0
  150. data/lib/advanced_billing/models/coupon_currency.rb +80 -0
  151. data/lib/advanced_billing/models/coupon_currency_request.rb +57 -0
  152. data/lib/advanced_billing/models/coupon_currency_response.rb +59 -0
  153. data/lib/advanced_billing/models/coupon_response.rb +50 -0
  154. data/lib/advanced_billing/models/coupon_restriction.rb +92 -0
  155. data/lib/advanced_billing/models/coupon_subcodes.rb +50 -0
  156. data/lib/advanced_billing/models/coupon_subcodes_response.rb +71 -0
  157. data/lib/advanced_billing/models/coupon_usage.rb +118 -0
  158. data/lib/advanced_billing/models/create_allocation.rb +198 -0
  159. data/lib/advanced_billing/models/create_allocation_request.rb +48 -0
  160. data/lib/advanced_billing/models/create_component_price_point.rb +163 -0
  161. data/lib/advanced_billing/models/create_component_price_point_request.rb +64 -0
  162. data/lib/advanced_billing/models/create_component_price_points_request.rb +64 -0
  163. data/lib/advanced_billing/models/create_currency_price.rb +70 -0
  164. data/lib/advanced_billing/models/create_currency_prices_request.rb +57 -0
  165. data/lib/advanced_billing/models/create_customer.rb +221 -0
  166. data/lib/advanced_billing/models/create_customer_request.rb +48 -0
  167. data/lib/advanced_billing/models/create_ebb_component.rb +49 -0
  168. data/lib/advanced_billing/models/create_invoice.rb +168 -0
  169. data/lib/advanced_billing/models/create_invoice_address.rb +130 -0
  170. data/lib/advanced_billing/models/create_invoice_coupon.rb +117 -0
  171. data/lib/advanced_billing/models/create_invoice_item.rb +192 -0
  172. data/lib/advanced_billing/models/create_invoice_payment.rb +92 -0
  173. data/lib/advanced_billing/models/create_invoice_payment_application.rb +58 -0
  174. data/lib/advanced_billing/models/create_invoice_payment_request.rb +59 -0
  175. data/lib/advanced_billing/models/create_invoice_request.rb +48 -0
  176. data/lib/advanced_billing/models/create_invoice_status.rb +23 -0
  177. data/lib/advanced_billing/models/create_metadata.rb +60 -0
  178. data/lib/advanced_billing/models/create_metadata_request.rb +57 -0
  179. data/lib/advanced_billing/models/create_metafield.rb +96 -0
  180. data/lib/advanced_billing/models/create_metafields_request.rb +64 -0
  181. data/lib/advanced_billing/models/create_metered_component.rb +49 -0
  182. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +133 -0
  183. data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +48 -0
  184. data/lib/advanced_billing/models/create_offer.rb +117 -0
  185. data/lib/advanced_billing/models/create_offer_component.rb +61 -0
  186. data/lib/advanced_billing/models/create_offer_request.rb +48 -0
  187. data/lib/advanced_billing/models/create_on_off_component.rb +49 -0
  188. data/lib/advanced_billing/models/create_or_update_coupon.rb +86 -0
  189. data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +228 -0
  190. data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +229 -0
  191. data/lib/advanced_billing/models/create_or_update_product.rb +146 -0
  192. data/lib/advanced_billing/models/create_or_update_product_request.rb +48 -0
  193. data/lib/advanced_billing/models/create_or_update_segment_price.rb +88 -0
  194. data/lib/advanced_billing/models/create_payment.rb +77 -0
  195. data/lib/advanced_billing/models/create_payment_profile.rb +430 -0
  196. data/lib/advanced_billing/models/create_payment_profile_request.rb +49 -0
  197. data/lib/advanced_billing/models/create_prepaid_component.rb +49 -0
  198. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +197 -0
  199. data/lib/advanced_billing/models/create_prepayment.rb +93 -0
  200. data/lib/advanced_billing/models/create_prepayment_request.rb +48 -0
  201. data/lib/advanced_billing/models/create_prepayment_response.rb +48 -0
  202. data/lib/advanced_billing/models/create_product_currency_price.rb +66 -0
  203. data/lib/advanced_billing/models/create_product_currency_prices_request.rb +57 -0
  204. data/lib/advanced_billing/models/create_product_family.rb +62 -0
  205. data/lib/advanced_billing/models/create_product_family_request.rb +49 -0
  206. data/lib/advanced_billing/models/create_product_price_point.rb +198 -0
  207. data/lib/advanced_billing/models/create_product_price_point_request.rb +48 -0
  208. data/lib/advanced_billing/models/create_quantity_based_component.rb +50 -0
  209. data/lib/advanced_billing/models/create_reason_code.rb +68 -0
  210. data/lib/advanced_billing/models/create_reason_code_request.rb +48 -0
  211. data/lib/advanced_billing/models/create_segment.rb +143 -0
  212. data/lib/advanced_billing/models/create_segment_request.rb +48 -0
  213. data/lib/advanced_billing/models/create_subscription.rb +756 -0
  214. data/lib/advanced_billing/models/create_subscription_component.rb +127 -0
  215. data/lib/advanced_billing/models/create_subscription_group.rb +75 -0
  216. data/lib/advanced_billing/models/create_subscription_group_request.rb +49 -0
  217. data/lib/advanced_billing/models/create_subscription_request.rb +48 -0
  218. data/lib/advanced_billing/models/create_usage.rb +88 -0
  219. data/lib/advanced_billing/models/create_usage_request.rb +48 -0
  220. data/lib/advanced_billing/models/created_prepayment.rb +117 -0
  221. data/lib/advanced_billing/models/credit_account_balance_changed.rb +122 -0
  222. data/lib/advanced_billing/models/credit_card_attributes.rb +72 -0
  223. data/lib/advanced_billing/models/credit_card_payment_profile.rb +306 -0
  224. data/lib/advanced_billing/models/credit_note.rb +417 -0
  225. data/lib/advanced_billing/models/credit_note1.rb +409 -0
  226. data/lib/advanced_billing/models/credit_note_application.rb +92 -0
  227. data/lib/advanced_billing/models/credit_note_line_item.rb +245 -0
  228. data/lib/advanced_billing/models/credit_note_status.rb +23 -0
  229. data/lib/advanced_billing/models/credit_scheme.rb +26 -0
  230. data/lib/advanced_billing/models/credit_scheme_request.rb +48 -0
  231. data/lib/advanced_billing/models/credit_type.rb +28 -0
  232. data/lib/advanced_billing/models/currency_price.rb +102 -0
  233. data/lib/advanced_billing/models/currency_price_role.rb +26 -0
  234. data/lib/advanced_billing/models/currency_prices_response.rb +57 -0
  235. data/lib/advanced_billing/models/current_vault.rb +99 -0
  236. data/lib/advanced_billing/models/custom_field_owner.rb +23 -0
  237. data/lib/advanced_billing/models/custom_field_value_change.rb +148 -0
  238. data/lib/advanced_billing/models/customer.rb +358 -0
  239. data/lib/advanced_billing/models/customer1.rb +114 -0
  240. data/lib/advanced_billing/models/customer_attributes.rb +243 -0
  241. data/lib/advanced_billing/models/customer_change.rb +103 -0
  242. data/lib/advanced_billing/models/customer_changes_preview_response.rb +48 -0
  243. data/lib/advanced_billing/models/customer_custom_fields_change.rb +97 -0
  244. data/lib/advanced_billing/models/customer_error.rb +60 -0
  245. data/lib/advanced_billing/models/customer_payer_change.rb +79 -0
  246. data/lib/advanced_billing/models/customer_response.rb +48 -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 +90 -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_event_data.rb +437 -0
  293. data/lib/advanced_billing/models/invoice_event_payment.rb +158 -0
  294. data/lib/advanced_billing/models/invoice_event_payment1.rb +150 -0
  295. data/lib/advanced_billing/models/invoice_event_payment_method.rb +32 -0
  296. data/lib/advanced_billing/models/invoice_event_type.rb +59 -0
  297. data/lib/advanced_billing/models/invoice_issued.rb +258 -0
  298. data/lib/advanced_billing/models/invoice_line_item.rb +332 -0
  299. data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +69 -0
  300. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +266 -0
  301. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +60 -0
  302. data/lib/advanced_billing/models/invoice_payer.rb +103 -0
  303. data/lib/advanced_billing/models/invoice_payer_change.rb +80 -0
  304. data/lib/advanced_billing/models/invoice_payment.rb +158 -0
  305. data/lib/advanced_billing/models/invoice_payment_application.rb +74 -0
  306. data/lib/advanced_billing/models/invoice_payment_method.rb +124 -0
  307. data/lib/advanced_billing/models/invoice_payment_method_type.rb +35 -0
  308. data/lib/advanced_billing/models/invoice_payment_type.rb +29 -0
  309. data/lib/advanced_billing/models/invoice_pre_payment.rb +75 -0
  310. data/lib/advanced_billing/models/invoice_previous_balance.rb +78 -0
  311. data/lib/advanced_billing/models/invoice_refund.rb +106 -0
  312. data/lib/advanced_billing/models/invoice_response.rb +48 -0
  313. data/lib/advanced_billing/models/invoice_role.rb +47 -0
  314. data/lib/advanced_billing/models/invoice_seller.rb +83 -0
  315. data/lib/advanced_billing/models/invoice_sort_field.rb +41 -0
  316. data/lib/advanced_billing/models/invoice_status.rb +37 -0
  317. data/lib/advanced_billing/models/invoice_tax.rb +172 -0
  318. data/lib/advanced_billing/models/invoice_tax_breakout.rb +71 -0
  319. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +81 -0
  320. data/lib/advanced_billing/models/issue_advance_invoice_request.rb +50 -0
  321. data/lib/advanced_billing/models/issue_invoice_event_data.rb +136 -0
  322. data/lib/advanced_billing/models/issue_invoice_request.rb +63 -0
  323. data/lib/advanced_billing/models/issue_service_credit.rb +81 -0
  324. data/lib/advanced_billing/models/issue_service_credit_request.rb +49 -0
  325. data/lib/advanced_billing/models/item_category.rb +33 -0
  326. data/lib/advanced_billing/models/item_price_point_changed.rb +133 -0
  327. data/lib/advanced_billing/models/item_price_point_data.rb +70 -0
  328. data/lib/advanced_billing/models/line_item_kind.rb +47 -0
  329. data/lib/advanced_billing/models/line_item_transaction_type.rb +38 -0
  330. data/lib/advanced_billing/models/list_components_price_points_include.rb +20 -0
  331. data/lib/advanced_billing/models/list_components_price_points_response.rb +57 -0
  332. data/lib/advanced_billing/models/list_credit_notes_response.rb +57 -0
  333. data/lib/advanced_billing/models/list_events_date_field.rb +20 -0
  334. data/lib/advanced_billing/models/list_invoice_events_response.rb +89 -0
  335. data/lib/advanced_billing/models/list_invoices_response.rb +57 -0
  336. data/lib/advanced_billing/models/list_metafields_response.rb +99 -0
  337. data/lib/advanced_billing/models/list_mrr_response.rb +48 -0
  338. data/lib/advanced_billing/models/list_mrr_response_result.rb +120 -0
  339. data/lib/advanced_billing/models/list_offers_response.rb +59 -0
  340. data/lib/advanced_billing/models/list_product_price_points_response.rb +57 -0
  341. data/lib/advanced_billing/models/list_products_include.rb +20 -0
  342. data/lib/advanced_billing/models/list_products_price_points_include.rb +20 -0
  343. data/lib/advanced_billing/models/list_public_keys_meta.rb +80 -0
  344. data/lib/advanced_billing/models/list_public_keys_response.rb +69 -0
  345. data/lib/advanced_billing/models/list_sale_rep_item.rb +93 -0
  346. data/lib/advanced_billing/models/list_segments_response.rb +59 -0
  347. data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +142 -0
  348. data/lib/advanced_billing/models/list_subscription_components_include.rb +20 -0
  349. data/lib/advanced_billing/models/list_subscription_components_response.rb +57 -0
  350. data/lib/advanced_billing/models/list_subscription_components_sort.rb +23 -0
  351. data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +49 -0
  352. data/lib/advanced_billing/models/list_subscription_group_prepayment_date_field.rb +23 -0
  353. data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +57 -0
  354. data/lib/advanced_billing/models/list_subscription_groups_item.rb +146 -0
  355. data/lib/advanced_billing/models/list_subscription_groups_meta.rb +60 -0
  356. data/lib/advanced_billing/models/list_subscription_groups_response.rb +69 -0
  357. data/lib/advanced_billing/models/metadata.rb +106 -0
  358. data/lib/advanced_billing/models/metafield.rb +124 -0
  359. data/lib/advanced_billing/models/metafield_input.rb +33 -0
  360. data/lib/advanced_billing/models/metafield_scope.rb +113 -0
  361. data/lib/advanced_billing/models/metered_component.rb +323 -0
  362. data/lib/advanced_billing/models/metered_usage.rb +135 -0
  363. data/lib/advanced_billing/models/movement.rb +143 -0
  364. data/lib/advanced_billing/models/movement_line_item.rb +148 -0
  365. data/lib/advanced_billing/models/mrr.rb +103 -0
  366. data/lib/advanced_billing/models/mrr_movement.rb +81 -0
  367. data/lib/advanced_billing/models/mrr_response.rb +48 -0
  368. data/lib/advanced_billing/models/multi_invoice_payment.rb +92 -0
  369. data/lib/advanced_billing/models/multi_invoice_payment_response.rb +48 -0
  370. data/lib/advanced_billing/models/nested_subscription_group.rb +94 -0
  371. data/lib/advanced_billing/models/net_terms.rb +95 -0
  372. data/lib/advanced_billing/models/offer.rb +266 -0
  373. data/lib/advanced_billing/models/offer_discount.rb +70 -0
  374. data/lib/advanced_billing/models/offer_item.rb +159 -0
  375. data/lib/advanced_billing/models/offer_response.rb +50 -0
  376. data/lib/advanced_billing/models/offer_signup_page.rb +100 -0
  377. data/lib/advanced_billing/models/on_off_component.rb +287 -0
  378. data/lib/advanced_billing/models/organization_address.rb +129 -0
  379. data/lib/advanced_billing/models/origin_invoice.rb +60 -0
  380. data/lib/advanced_billing/models/overage_pricing.rb +73 -0
  381. data/lib/advanced_billing/models/override_subscription.rb +134 -0
  382. data/lib/advanced_billing/models/override_subscription_request.rb +48 -0
  383. data/lib/advanced_billing/models/paginated_metadata.rb +99 -0
  384. data/lib/advanced_billing/models/pause_request.rb +50 -0
  385. data/lib/advanced_billing/models/payer_attributes.rb +223 -0
  386. data/lib/advanced_billing/models/payer_error.rb +70 -0
  387. data/lib/advanced_billing/models/payment.rb +82 -0
  388. data/lib/advanced_billing/models/payment_collection_method_changed.rb +80 -0
  389. data/lib/advanced_billing/models/payment_for_allocation.rb +91 -0
  390. data/lib/advanced_billing/models/payment_method_apple_pay.rb +62 -0
  391. data/lib/advanced_billing/models/payment_method_bank_account.rb +94 -0
  392. data/lib/advanced_billing/models/payment_method_credit_card.rb +117 -0
  393. data/lib/advanced_billing/models/payment_method_external.rb +108 -0
  394. data/lib/advanced_billing/models/payment_method_paypal.rb +79 -0
  395. data/lib/advanced_billing/models/payment_profile_attributes.rb +370 -0
  396. data/lib/advanced_billing/models/payment_profile_response.rb +64 -0
  397. data/lib/advanced_billing/models/payment_related_events.rb +80 -0
  398. data/lib/advanced_billing/models/payment_response.rb +69 -0
  399. data/lib/advanced_billing/models/payment_type.rb +26 -0
  400. data/lib/advanced_billing/models/pending_cancellation_change.rb +80 -0
  401. data/lib/advanced_billing/models/portal_management_link.rb +104 -0
  402. data/lib/advanced_billing/models/prepaid_component_price_point.rb +107 -0
  403. data/lib/advanced_billing/models/prepaid_configuration.rb +105 -0
  404. data/lib/advanced_billing/models/prepaid_configuration_response.rb +49 -0
  405. data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +111 -0
  406. data/lib/advanced_billing/models/prepaid_usage.rb +200 -0
  407. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +71 -0
  408. data/lib/advanced_billing/models/prepaid_usage_component.rb +358 -0
  409. data/lib/advanced_billing/models/prepayment.rb +137 -0
  410. data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +109 -0
  411. data/lib/advanced_billing/models/prepayment_aggregated_error.rb +71 -0
  412. data/lib/advanced_billing/models/prepayment_method.rb +41 -0
  413. data/lib/advanced_billing/models/prepayment_response.rb +48 -0
  414. data/lib/advanced_billing/models/prepayments_response.rb +59 -0
  415. data/lib/advanced_billing/models/preview_allocations_request.rb +99 -0
  416. data/lib/advanced_billing/models/price.rb +99 -0
  417. data/lib/advanced_billing/models/price_point.rb +206 -0
  418. data/lib/advanced_billing/models/price_point_type.rb +30 -0
  419. data/lib/advanced_billing/models/pricing_scheme.rb +31 -0
  420. data/lib/advanced_billing/models/product.rb +547 -0
  421. data/lib/advanced_billing/models/product_family.rb +114 -0
  422. data/lib/advanced_billing/models/product_family_response.rb +50 -0
  423. data/lib/advanced_billing/models/product_price_point.rb +346 -0
  424. data/lib/advanced_billing/models/product_price_point_errors.rb +101 -0
  425. data/lib/advanced_billing/models/product_price_point_response.rb +48 -0
  426. data/lib/advanced_billing/models/product_response.rb +48 -0
  427. data/lib/advanced_billing/models/proforma_error.rb +51 -0
  428. data/lib/advanced_billing/models/proforma_invoice.rb +484 -0
  429. data/lib/advanced_billing/models/proforma_invoice_credit.rb +82 -0
  430. data/lib/advanced_billing/models/proforma_invoice_discount.rb +111 -0
  431. data/lib/advanced_billing/models/proforma_invoice_discount_breakout.rb +62 -0
  432. data/lib/advanced_billing/models/proforma_invoice_issued.rb +205 -0
  433. data/lib/advanced_billing/models/proforma_invoice_payment.rb +82 -0
  434. data/lib/advanced_billing/models/proforma_invoice_preview.rb +484 -0
  435. data/lib/advanced_billing/models/proforma_invoice_tax.rb +120 -0
  436. data/lib/advanced_billing/models/proforma_invoice_tax_breakout.rb +61 -0
  437. data/lib/advanced_billing/models/proration.rb +52 -0
  438. data/lib/advanced_billing/models/public_key.rb +71 -0
  439. data/lib/advanced_billing/models/public_signup_page.rb +84 -0
  440. data/lib/advanced_billing/models/quantity_based_component.rb +333 -0
  441. data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +61 -0
  442. data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +135 -0
  443. data/lib/advanced_billing/models/reactivate_subscription_request.rb +125 -0
  444. data/lib/advanced_billing/models/reactivation_billing.rb +56 -0
  445. data/lib/advanced_billing/models/reactivation_charge.rb +30 -0
  446. data/lib/advanced_billing/models/reason_code.rb +110 -0
  447. data/lib/advanced_billing/models/reason_code_response.rb +48 -0
  448. data/lib/advanced_billing/models/reason_codes_json_response.rb +50 -0
  449. data/lib/advanced_billing/models/record_payment_request.rb +48 -0
  450. data/lib/advanced_billing/models/recurring_scheme.rb +26 -0
  451. data/lib/advanced_billing/models/referral_code.rb +81 -0
  452. data/lib/advanced_billing/models/referral_validation_response.rb +50 -0
  453. data/lib/advanced_billing/models/refund.rb +128 -0
  454. data/lib/advanced_billing/models/refund_consolidated_invoice.rb +129 -0
  455. data/lib/advanced_billing/models/refund_invoice.rb +128 -0
  456. data/lib/advanced_billing/models/refund_invoice_event_data.rb +195 -0
  457. data/lib/advanced_billing/models/refund_invoice_request.rb +64 -0
  458. data/lib/advanced_billing/models/refund_prepayment.rb +108 -0
  459. data/lib/advanced_billing/models/refund_prepayment_aggregated_error.rb +50 -0
  460. data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +50 -0
  461. data/lib/advanced_billing/models/refund_prepayment_request.rb +48 -0
  462. data/lib/advanced_billing/models/refund_success.rb +93 -0
  463. data/lib/advanced_billing/models/remove_payment_event_data.rb +155 -0
  464. data/lib/advanced_billing/models/renewal_preview.rb +161 -0
  465. data/lib/advanced_billing/models/renewal_preview_component.rb +93 -0
  466. data/lib/advanced_billing/models/renewal_preview_line_item.rb +189 -0
  467. data/lib/advanced_billing/models/renewal_preview_request.rb +62 -0
  468. data/lib/advanced_billing/models/renewal_preview_response.rb +49 -0
  469. data/lib/advanced_billing/models/replay_webhooks_request.rb +48 -0
  470. data/lib/advanced_billing/models/replay_webhooks_response.rb +50 -0
  471. data/lib/advanced_billing/models/resent_invitation.rb +83 -0
  472. data/lib/advanced_billing/models/resource_type.rb +23 -0
  473. data/lib/advanced_billing/models/restriction_type.rb +23 -0
  474. data/lib/advanced_billing/models/resume_options.rb +76 -0
  475. data/lib/advanced_billing/models/resumption_charge.rb +27 -0
  476. data/lib/advanced_billing/models/revoked_invitation.rb +72 -0
  477. data/lib/advanced_billing/models/sale_rep.rb +100 -0
  478. data/lib/advanced_billing/models/sale_rep_item_mrr.rb +70 -0
  479. data/lib/advanced_billing/models/sale_rep_settings.rb +113 -0
  480. data/lib/advanced_billing/models/sale_rep_subscription.rb +143 -0
  481. data/lib/advanced_billing/models/segment.rb +210 -0
  482. data/lib/advanced_billing/models/segment_price.rb +126 -0
  483. data/lib/advanced_billing/models/segment_response.rb +50 -0
  484. data/lib/advanced_billing/models/seller.rb +82 -0
  485. data/lib/advanced_billing/models/send_invoice_request.rb +73 -0
  486. data/lib/advanced_billing/models/service_credit.rb +92 -0
  487. data/lib/advanced_billing/models/service_credit_response.rb +48 -0
  488. data/lib/advanced_billing/models/service_credit_type.rb +23 -0
  489. data/lib/advanced_billing/models/shipping_address.rb +107 -0
  490. data/lib/advanced_billing/models/signup_proforma_preview.rb +62 -0
  491. data/lib/advanced_billing/models/signup_proforma_preview_response.rb +50 -0
  492. data/lib/advanced_billing/models/site.rb +220 -0
  493. data/lib/advanced_billing/models/site_response.rb +48 -0
  494. data/lib/advanced_billing/models/site_statistics.rb +174 -0
  495. data/lib/advanced_billing/models/site_summary.rb +90 -0
  496. data/lib/advanced_billing/models/snap_day.rb +21 -0
  497. data/lib/advanced_billing/models/sorting_direction.rb +23 -0
  498. data/lib/advanced_billing/models/subscription.rb +1014 -0
  499. data/lib/advanced_billing/models/subscription_component.rb +460 -0
  500. data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +60 -0
  501. data/lib/advanced_billing/models/subscription_component_response.rb +50 -0
  502. data/lib/advanced_billing/models/subscription_component_subscription.rb +197 -0
  503. data/lib/advanced_billing/models/subscription_custom_price.rb +212 -0
  504. data/lib/advanced_billing/models/subscription_date_field.rb +44 -0
  505. data/lib/advanced_billing/models/subscription_group.rb +96 -0
  506. data/lib/advanced_billing/models/subscription_group_balances.rb +82 -0
  507. data/lib/advanced_billing/models/subscription_group_bank_account.rb +216 -0
  508. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +96 -0
  509. data/lib/advanced_billing/models/subscription_group_credit_card.rb +273 -0
  510. data/lib/advanced_billing/models/subscription_group_customer.rb +90 -0
  511. data/lib/advanced_billing/models/subscription_group_item.rb +152 -0
  512. data/lib/advanced_billing/models/subscription_group_member_error.rb +70 -0
  513. data/lib/advanced_billing/models/subscription_group_payment_profile.rb +81 -0
  514. data/lib/advanced_billing/models/subscription_group_prepayment.rb +75 -0
  515. data/lib/advanced_billing/models/subscription_group_prepayment_method.rb +35 -0
  516. data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +48 -0
  517. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +92 -0
  518. data/lib/advanced_billing/models/subscription_group_response.rb +49 -0
  519. data/lib/advanced_billing/models/subscription_group_signup.rb +154 -0
  520. data/lib/advanced_billing/models/subscription_group_signup_component.rb +110 -0
  521. data/lib/advanced_billing/models/subscription_group_signup_error.rb +112 -0
  522. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +83 -0
  523. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +140 -0
  524. data/lib/advanced_billing/models/subscription_group_signup_item.rb +197 -0
  525. data/lib/advanced_billing/models/subscription_group_signup_request.rb +49 -0
  526. data/lib/advanced_billing/models/subscription_group_signup_response.rb +171 -0
  527. data/lib/advanced_billing/models/subscription_group_signup_success.rb +81 -0
  528. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +125 -0
  529. data/lib/advanced_billing/models/subscription_group_subscription_error.rb +87 -0
  530. data/lib/advanced_billing/models/subscription_group_update_error.rb +59 -0
  531. data/lib/advanced_billing/models/subscription_include.rb +23 -0
  532. data/lib/advanced_billing/models/subscription_included_coupon.rb +115 -0
  533. data/lib/advanced_billing/models/subscription_list_date_field.rb +20 -0
  534. data/lib/advanced_billing/models/subscription_list_include.rb +20 -0
  535. data/lib/advanced_billing/models/subscription_migration_preview.rb +90 -0
  536. data/lib/advanced_billing/models/subscription_migration_preview_options.rb +163 -0
  537. data/lib/advanced_billing/models/subscription_migration_preview_request.rb +49 -0
  538. data/lib/advanced_billing/models/subscription_migration_preview_response.rb +48 -0
  539. data/lib/advanced_billing/models/subscription_mrr.rb +70 -0
  540. data/lib/advanced_billing/models/subscription_mrr_breakout.rb +59 -0
  541. data/lib/advanced_billing/models/subscription_mrr_response.rb +57 -0
  542. data/lib/advanced_billing/models/subscription_note.rb +101 -0
  543. data/lib/advanced_billing/models/subscription_note_response.rb +48 -0
  544. data/lib/advanced_billing/models/subscription_preview.rb +62 -0
  545. data/lib/advanced_billing/models/subscription_preview_response.rb +49 -0
  546. data/lib/advanced_billing/models/subscription_product_change.rb +81 -0
  547. data/lib/advanced_billing/models/subscription_product_migration.rb +152 -0
  548. data/lib/advanced_billing/models/subscription_product_migration_request.rb +48 -0
  549. data/lib/advanced_billing/models/subscription_purge_type.rb +23 -0
  550. data/lib/advanced_billing/models/subscription_response.rb +50 -0
  551. data/lib/advanced_billing/models/subscription_sort.rb +35 -0
  552. data/lib/advanced_billing/models/subscription_state.rb +118 -0
  553. data/lib/advanced_billing/models/subscription_state_change.rb +81 -0
  554. data/lib/advanced_billing/models/subscription_state_filter.rb +53 -0
  555. data/lib/advanced_billing/models/tax_configuration.rb +74 -0
  556. data/lib/advanced_billing/models/tax_configuration_kind.rb +29 -0
  557. data/lib/advanced_billing/models/tax_destination_address.rb +29 -0
  558. data/lib/advanced_billing/models/too_many_management_link_requests.rb +64 -0
  559. data/lib/advanced_billing/models/update_allocation_expiration_date.rb +50 -0
  560. data/lib/advanced_billing/models/update_component.rb +146 -0
  561. data/lib/advanced_billing/models/update_component_price_point.rb +141 -0
  562. data/lib/advanced_billing/models/update_component_price_point_request.rb +51 -0
  563. data/lib/advanced_billing/models/update_component_request.rb +48 -0
  564. data/lib/advanced_billing/models/update_coupon_currency.rb +57 -0
  565. data/lib/advanced_billing/models/update_currency_price.rb +57 -0
  566. data/lib/advanced_billing/models/update_currency_prices_request.rb +57 -0
  567. data/lib/advanced_billing/models/update_customer.rb +223 -0
  568. data/lib/advanced_billing/models/update_customer_request.rb +48 -0
  569. data/lib/advanced_billing/models/update_endpoint.rb +58 -0
  570. data/lib/advanced_billing/models/update_endpoint_request.rb +48 -0
  571. data/lib/advanced_billing/models/update_metadata.rb +70 -0
  572. data/lib/advanced_billing/models/update_metadata_request.rb +50 -0
  573. data/lib/advanced_billing/models/update_metafield.rb +106 -0
  574. data/lib/advanced_billing/models/update_metafields_request.rb +62 -0
  575. data/lib/advanced_billing/models/update_payment_profile.rb +194 -0
  576. data/lib/advanced_billing/models/update_payment_profile_request.rb +49 -0
  577. data/lib/advanced_billing/models/update_price.rb +109 -0
  578. data/lib/advanced_billing/models/update_product_price_point.rb +61 -0
  579. data/lib/advanced_billing/models/update_product_price_point_request.rb +48 -0
  580. data/lib/advanced_billing/models/update_reason_code.rb +70 -0
  581. data/lib/advanced_billing/models/update_reason_code_request.rb +48 -0
  582. data/lib/advanced_billing/models/update_segment.rb +73 -0
  583. data/lib/advanced_billing/models/update_segment_request.rb +48 -0
  584. data/lib/advanced_billing/models/update_subscription.rb +278 -0
  585. data/lib/advanced_billing/models/update_subscription_component.rb +61 -0
  586. data/lib/advanced_billing/models/update_subscription_group.rb +50 -0
  587. data/lib/advanced_billing/models/update_subscription_group_request.rb +49 -0
  588. data/lib/advanced_billing/models/update_subscription_note.rb +57 -0
  589. data/lib/advanced_billing/models/update_subscription_note_request.rb +48 -0
  590. data/lib/advanced_billing/models/update_subscription_request.rb +48 -0
  591. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +95 -0
  592. data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +49 -0
  593. data/lib/advanced_billing/models/usage.rb +155 -0
  594. data/lib/advanced_billing/models/usage_response.rb +48 -0
  595. data/lib/advanced_billing/models/void_invoice.rb +48 -0
  596. data/lib/advanced_billing/models/void_invoice_event_data.rb +148 -0
  597. data/lib/advanced_billing/models/void_invoice_request.rb +48 -0
  598. data/lib/advanced_billing/models/void_remainder_event_data.rb +115 -0
  599. data/lib/advanced_billing/models/webhook.rb +173 -0
  600. data/lib/advanced_billing/models/webhook_order.rb +23 -0
  601. data/lib/advanced_billing/models/webhook_response.rb +50 -0
  602. data/lib/advanced_billing/models/webhook_status.rb +29 -0
  603. data/lib/advanced_billing/models/webhook_subscription.rb +124 -0
  604. data/lib/advanced_billing/utilities/date_time_helper.rb +11 -0
  605. data/lib/advanced_billing/utilities/file_wrapper.rb +16 -0
  606. data/lib/advanced_billing/utilities/union_type_lookup.rb +1143 -0
  607. data/lib/advanced_billing.rb +671 -0
  608. metadata +608 -105
  609. data/bin/arch +0 -1
  610. data/bin/ash +0 -1
  611. data/bin/base64 +0 -1
  612. data/bin/bbconfig +0 -1
  613. data/bin/busybox +0 -0
  614. data/bin/cat +0 -1
  615. data/bin/chattr +0 -1
  616. data/bin/chgrp +0 -1
  617. data/bin/chmod +0 -1
  618. data/bin/chown +0 -1
  619. data/bin/cp +0 -1
  620. data/bin/date +0 -1
  621. data/bin/dd +0 -1
  622. data/bin/df +0 -1
  623. data/bin/dmesg +0 -1
  624. data/bin/dnsdomainname +0 -1
  625. data/bin/dumpkmap +0 -1
  626. data/bin/echo +0 -1
  627. data/bin/ed +0 -1
  628. data/bin/egrep +0 -1
  629. data/bin/false +0 -1
  630. data/bin/fatattr +0 -1
  631. data/bin/fdflush +0 -1
  632. data/bin/fgrep +0 -1
  633. data/bin/fsync +0 -1
  634. data/bin/getopt +0 -1
  635. data/bin/grep +0 -1
  636. data/bin/gunzip +0 -1
  637. data/bin/gzip +0 -1
  638. data/bin/hostname +0 -1
  639. data/bin/ionice +0 -1
  640. data/bin/iostat +0 -1
  641. data/bin/ipcalc +0 -1
  642. data/bin/kbd_mode +0 -1
  643. data/bin/kill +0 -1
  644. data/bin/link +0 -1
  645. data/bin/linux32 +0 -1
  646. data/bin/linux64 +0 -1
  647. data/bin/ln +0 -1
  648. data/bin/login +0 -1
  649. data/bin/ls +0 -1
  650. data/bin/lsattr +0 -1
  651. data/bin/lzop +0 -1
  652. data/bin/makemime +0 -1
  653. data/bin/mkdir +0 -1
  654. data/bin/mknod +0 -1
  655. data/bin/mktemp +0 -1
  656. data/bin/more +0 -1
  657. data/bin/mount +0 -1
  658. data/bin/mountpoint +0 -1
  659. data/bin/mpstat +0 -1
  660. data/bin/mv +0 -1
  661. data/bin/netstat +0 -1
  662. data/bin/nice +0 -1
  663. data/bin/pidof +0 -0
  664. data/bin/ping +0 -1
  665. data/bin/ping6 +0 -1
  666. data/bin/pipe_progress +0 -1
  667. data/bin/printenv +0 -1
  668. data/bin/ps +0 -0
  669. data/bin/pwait +0 -0
  670. data/bin/pwd +0 -1
  671. data/bin/reformime +0 -1
  672. data/bin/rev +0 -1
  673. data/bin/rm +0 -1
  674. data/bin/rmdir +0 -1
  675. data/bin/run-parts +0 -1
  676. data/bin/sed +0 -1
  677. data/bin/setpriv +0 -1
  678. data/bin/setserial +0 -1
  679. data/bin/sh +0 -1
  680. data/bin/slabtop +0 -0
  681. data/bin/sleep +0 -1
  682. data/bin/stat +0 -1
  683. data/bin/stty +0 -1
  684. data/bin/su +0 -1
  685. data/bin/sync +0 -1
  686. data/bin/tar +0 -1
  687. data/bin/tload +0 -0
  688. data/bin/touch +0 -1
  689. data/bin/true +0 -1
  690. data/bin/umount +0 -1
  691. data/bin/uname +0 -1
  692. data/bin/usleep +0 -1
  693. data/bin/vmstat +0 -0
  694. data/bin/w +0 -0
  695. data/bin/watch +0 -0
  696. data/bin/zcat +0 -1
  697. data/lib/apk/db/installed +0 -3582
  698. data/lib/apk/db/lock +0 -0
  699. data/lib/apk/db/scripts.tar +0 -0
  700. data/lib/apk/db/triggers +0 -2
  701. data/lib/ld-musl-x86_64.so.1 +0 -0
  702. data/lib/libapk.so.3.12.0 +0 -0
  703. data/lib/libc.musl-x86_64.so.1 +0 -1
  704. data/lib/libcrypto.so.1.1 +0 -0
  705. data/lib/libprocps.so.8 +0 -1
  706. data/lib/libprocps.so.8.0.3 +0 -0
  707. data/lib/libssl.so.1.1 +0 -0
  708. data/lib/libz.so +0 -1
  709. data/lib/libz.so.1 +0 -1
  710. data/lib/libz.so.1.2.12 +0 -0
  711. data/lib/sysctl.d/00-alpine.conf +0 -40
@@ -0,0 +1,667 @@
1
+ # advanced_billing
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module AdvancedBilling
7
+ # CouponsController
8
+ class CouponsController < BaseController
9
+ # ## Coupons Documentation
10
+ # Coupons can be administered in the Chargify application or created via
11
+ # API. Please view our section on [creating
12
+ # coupons](https://maxio-chargify.zendesk.com/hc/en-us/articles/540474283073
13
+ # 3) for more information.
14
+ # Additionally, for documentation on how to apply a coupon to a subscription
15
+ # within the Chargify UI, please see our documentation
16
+ # [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404761012877)
17
+ # .
18
+ # ## Create Coupon
19
+ # This request will create a coupon, based on the provided information.
20
+ # When creating a coupon, you must specify a product family using the
21
+ # `product_family_id`. If no `product_family_id` is passed, the first
22
+ # product family available is used. You will also need to formulate your URL
23
+ # to cite the Product Family ID in your request.
24
+ # You can restrict a coupon to only apply to specific products / components
25
+ # by optionally passing in hashes of `restricted_products` and/or
26
+ # `restricted_components` in the format:
27
+ # `{ "<product/component_id>": boolean_value }`
28
+ # @param [Integer] product_family_id Required parameter: The Chargify id of
29
+ # the product family to which the coupon belongs
30
+ # @param [CreateOrUpdateCoupon] body Optional parameter: Example:
31
+ # @return [CouponResponse] response from the API call
32
+ def create_coupon(product_family_id,
33
+ body: nil)
34
+ new_api_call_builder
35
+ .request(new_request_builder(HttpMethodEnum::POST,
36
+ '/product_families/{product_family_id}/coupons.json',
37
+ Server::DEFAULT)
38
+ .template_param(new_parameter(product_family_id, key: 'product_family_id')
39
+ .is_required(true)
40
+ .should_encode(true))
41
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
42
+ .body_param(new_parameter(body))
43
+ .header_param(new_parameter('application/json', key: 'accept'))
44
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
45
+ .auth(Single.new('global')))
46
+ .response(new_response_handler
47
+ .deserializer(APIHelper.method(:custom_type_deserializer))
48
+ .deserialize_into(CouponResponse.method(:from_hash))
49
+ .local_error_template('422',
50
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
51
+ ' Response: \'{$response.body}\'.',
52
+ ErrorListResponseException))
53
+ .execute
54
+ end
55
+
56
+ # List coupons for a specific Product Family in a Site.
57
+ # If the coupon is set to `use_site_exchange_rate: true`, it will return
58
+ # pricing based on the current exchange rate. If the flag is set to false,
59
+ # it will return all of the defined prices for each currency.
60
+ # @param [Integer] product_family_id Required parameter: The Chargify id of
61
+ # the product family to which the coupon belongs
62
+ # @param [Integer] page Optional parameter: Result records are organized in
63
+ # pages. By default, the first page of results is displayed. The page
64
+ # parameter specifies a page number of results to fetch. You can start
65
+ # navigating through the pages to consume the results. You do this by
66
+ # passing in a page parameter. Retrieve the next page by adding ?page=2 to
67
+ # the query string. If there are no results to return, then an empty result
68
+ # set will be returned. Use in query `page=1`.
69
+ # @param [Integer] per_page Optional parameter: This parameter indicates how
70
+ # many records to fetch in each request. Default value is 30. The maximum
71
+ # allowed values is 200; any per_page value over 200 will be changed to 200.
72
+ # Use in query `per_page=200`.
73
+ # @param [BasicDateField] filter_date_field Optional parameter: The type of
74
+ # filter you would like to apply to your search. Use in query
75
+ # `filter[date_field]=created_at`.
76
+ # @param [Date] filter_end_date Optional parameter: The end date (format
77
+ # YYYY-MM-DD) with which to filter the date_field. Returns coupons with a
78
+ # timestamp up to and including 11:59:59PM in your site’s time zone on the
79
+ # date specified. Use in query `filter[date_field]=2011-12-15`.
80
+ # @param [DateTime] filter_end_datetime Optional parameter: The end date and
81
+ # time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field.
82
+ # Returns coupons with a timestamp at or before exact time provided in
83
+ # query. You can specify timezone in query - otherwise your site's time zone
84
+ # will be used. If provided, this parameter will be used instead of
85
+ # end_date. Use in query `?filter[end_datetime]=2011-12-1T10:15:30+01:00`.
86
+ # @param [Date] filter_start_date Optional parameter: The start date (format
87
+ # YYYY-MM-DD) with which to filter the date_field. Returns coupons with a
88
+ # timestamp at or after midnight (12:00:00 AM) in your site’s time zone on
89
+ # the date specified. Use in query `filter[start_date]=2011-12-17`.
90
+ # @param [DateTime] filter_start_datetime Optional parameter: The start date
91
+ # and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field.
92
+ # Returns coupons with a timestamp at or after exact time provided in query.
93
+ # You can specify timezone in query - otherwise your site's time zone will
94
+ # be used. If provided, this parameter will be used instead of start_date.
95
+ # Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`.
96
+ # @param [Array[Integer]] filter_ids Optional parameter: Allows fetching
97
+ # coupons with matching id based on provided values. Use in query
98
+ # `filter[ids]=1,2,3`.
99
+ # @param [Array[String]] filter_codes Optional parameter: Allows fetching
100
+ # coupons with matching codes based on provided values. Use in query
101
+ # `filter[codes]=free,free_trial`.
102
+ # @param [TrueClass | FalseClass] currency_prices Optional parameter: When
103
+ # fetching coupons, if you have defined multiple currencies at the site
104
+ # level, you can optionally pass the `?currency_prices=true` query param to
105
+ # include an array of currency price data in the response. Use in query
106
+ # `currency_prices=true`.
107
+ # @param [TrueClass | FalseClass] filter_use_site_exchange_rate Optional
108
+ # parameter: Allows fetching coupons with matching use_site_exchange_rate
109
+ # based on provided value. Use in query
110
+ # `filter[use_site_exchange_rate]=true`.
111
+ # @return [Array[CouponResponse]] response from the API call
112
+ def list_coupons_for_product_family(options = {})
113
+ new_api_call_builder
114
+ .request(new_request_builder(HttpMethodEnum::GET,
115
+ '/product_families/{product_family_id}/coupons.json',
116
+ Server::DEFAULT)
117
+ .template_param(new_parameter(options['product_family_id'], key: 'product_family_id')
118
+ .is_required(true)
119
+ .should_encode(true))
120
+ .query_param(new_parameter(options['page'], key: 'page'))
121
+ .query_param(new_parameter(options['per_page'], key: 'per_page'))
122
+ .query_param(new_parameter(options['filter_date_field'], key: 'filter[date_field]'))
123
+ .query_param(new_parameter(options['filter_end_date'], key: 'filter[end_date]'))
124
+ .query_param(new_parameter(options['filter_end_datetime'], key: 'filter[end_datetime]'))
125
+ .query_param(new_parameter(options['filter_start_date'], key: 'filter[start_date]'))
126
+ .query_param(new_parameter(options['filter_start_datetime'], key: 'filter[start_datetime]'))
127
+ .query_param(new_parameter(options['filter_ids'], key: 'filter[ids]'))
128
+ .query_param(new_parameter(options['filter_codes'], key: 'filter[codes]'))
129
+ .query_param(new_parameter(options['currency_prices'], key: 'currency_prices'))
130
+ .query_param(new_parameter(options['filter_use_site_exchange_rate'], key: 'filter[use_site_exchange_rate]'))
131
+ .header_param(new_parameter('application/json', key: 'accept'))
132
+ .auth(Single.new('global'))
133
+ .array_serialization_format(ArraySerializationFormat::CSV))
134
+ .response(new_response_handler
135
+ .deserializer(APIHelper.method(:custom_type_deserializer))
136
+ .deserialize_into(CouponResponse.method(:from_hash))
137
+ .is_response_array(true))
138
+ .execute
139
+ end
140
+
141
+ # You can search for a coupon via the API with the find method. By passing a
142
+ # code parameter, the find will attempt to locate a coupon that matches that
143
+ # code. If no coupon is found, a 404 is returned.
144
+ # If you have more than one product family and if the coupon you are trying
145
+ # to find does not belong to the default product family in your site, then
146
+ # you will need to specify (either in the url or as a query string param)
147
+ # the product family id.
148
+ # @param [Integer] product_family_id Optional parameter: The Chargify id of
149
+ # the product family to which the coupon belongs
150
+ # @param [String] code Optional parameter: The code of the coupon
151
+ # @return [CouponResponse] response from the API call
152
+ def find_coupon(product_family_id: nil,
153
+ code: nil)
154
+ new_api_call_builder
155
+ .request(new_request_builder(HttpMethodEnum::GET,
156
+ '/coupons/find.json',
157
+ Server::DEFAULT)
158
+ .query_param(new_parameter(product_family_id, key: 'product_family_id'))
159
+ .query_param(new_parameter(code, key: 'code'))
160
+ .header_param(new_parameter('application/json', key: 'accept'))
161
+ .auth(Single.new('global')))
162
+ .response(new_response_handler
163
+ .deserializer(APIHelper.method(:custom_type_deserializer))
164
+ .deserialize_into(CouponResponse.method(:from_hash)))
165
+ .execute
166
+ end
167
+
168
+ # You can retrieve the Coupon via the API with the Show method. You must
169
+ # identify the Coupon in this call by the ID parameter that Chargify
170
+ # assigns.
171
+ # If instead you would like to find a Coupon using a Coupon code, see the
172
+ # Coupon Find method.
173
+ # When fetching a coupon, if you have defined multiple currencies at the
174
+ # site level, you can optionally pass the `?currency_prices=true` query
175
+ # param to include an array of currency price data in the response.
176
+ # If the coupon is set to `use_site_exchange_rate: true`, it will return
177
+ # pricing based on the current exchange rate. If the flag is set to false,
178
+ # it will return all of the defined prices for each currency.
179
+ # @param [Integer] product_family_id Required parameter: The Chargify id of
180
+ # the product family to which the coupon belongs
181
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
182
+ # coupon
183
+ # @return [CouponResponse] response from the API call
184
+ def read_coupon(product_family_id,
185
+ coupon_id)
186
+ new_api_call_builder
187
+ .request(new_request_builder(HttpMethodEnum::GET,
188
+ '/product_families/{product_family_id}/coupons/{coupon_id}.json',
189
+ Server::DEFAULT)
190
+ .template_param(new_parameter(product_family_id, key: 'product_family_id')
191
+ .is_required(true)
192
+ .should_encode(true))
193
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
194
+ .is_required(true)
195
+ .should_encode(true))
196
+ .header_param(new_parameter('application/json', key: 'accept'))
197
+ .auth(Single.new('global')))
198
+ .response(new_response_handler
199
+ .deserializer(APIHelper.method(:custom_type_deserializer))
200
+ .deserialize_into(CouponResponse.method(:from_hash)))
201
+ .execute
202
+ end
203
+
204
+ # ## Update Coupon
205
+ # You can update a Coupon via the API with a PUT request to the resource
206
+ # endpoint.
207
+ # You can restrict a coupon to only apply to specific products / components
208
+ # by optionally passing in hashes of `restricted_products` and/or
209
+ # `restricted_components` in the format:
210
+ # `{ "<product/component_id>": boolean_value }`
211
+ # @param [Integer] product_family_id Required parameter: The Chargify id of
212
+ # the product family to which the coupon belongs
213
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
214
+ # coupon
215
+ # @param [CreateOrUpdateCoupon] body Optional parameter: Example:
216
+ # @return [CouponResponse] response from the API call
217
+ def update_coupon(product_family_id,
218
+ coupon_id,
219
+ body: nil)
220
+ new_api_call_builder
221
+ .request(new_request_builder(HttpMethodEnum::PUT,
222
+ '/product_families/{product_family_id}/coupons/{coupon_id}.json',
223
+ Server::DEFAULT)
224
+ .template_param(new_parameter(product_family_id, key: 'product_family_id')
225
+ .is_required(true)
226
+ .should_encode(true))
227
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
228
+ .is_required(true)
229
+ .should_encode(true))
230
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
231
+ .body_param(new_parameter(body))
232
+ .header_param(new_parameter('application/json', key: 'accept'))
233
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
234
+ .auth(Single.new('global')))
235
+ .response(new_response_handler
236
+ .deserializer(APIHelper.method(:custom_type_deserializer))
237
+ .deserialize_into(CouponResponse.method(:from_hash)))
238
+ .execute
239
+ end
240
+
241
+ # You can archive a Coupon via the API with the archive method.
242
+ # Archiving makes that Coupon unavailable for future use, but allows it to
243
+ # remain attached and functional on existing Subscriptions that are using
244
+ # it.
245
+ # The `archived_at` date and time will be assigned.
246
+ # @param [Integer] product_family_id Required parameter: The Chargify id of
247
+ # the product family to which the coupon belongs
248
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
249
+ # coupon
250
+ # @return [CouponResponse] response from the API call
251
+ def archive_coupon(product_family_id,
252
+ coupon_id)
253
+ new_api_call_builder
254
+ .request(new_request_builder(HttpMethodEnum::DELETE,
255
+ '/product_families/{product_family_id}/coupons/{coupon_id}.json',
256
+ Server::DEFAULT)
257
+ .template_param(new_parameter(product_family_id, key: 'product_family_id')
258
+ .is_required(true)
259
+ .should_encode(true))
260
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
261
+ .is_required(true)
262
+ .should_encode(true))
263
+ .header_param(new_parameter('application/json', key: 'accept'))
264
+ .auth(Single.new('global')))
265
+ .response(new_response_handler
266
+ .deserializer(APIHelper.method(:custom_type_deserializer))
267
+ .deserialize_into(CouponResponse.method(:from_hash)))
268
+ .execute
269
+ end
270
+
271
+ # You can retrieve a list of coupons.
272
+ # If the coupon is set to `use_site_exchange_rate: true`, it will return
273
+ # pricing based on the current exchange rate. If the flag is set to false,
274
+ # it will return all of the defined prices for each currency.
275
+ # @param [Integer] page Optional parameter: Result records are organized in
276
+ # pages. By default, the first page of results is displayed. The page
277
+ # parameter specifies a page number of results to fetch. You can start
278
+ # navigating through the pages to consume the results. You do this by
279
+ # passing in a page parameter. Retrieve the next page by adding ?page=2 to
280
+ # the query string. If there are no results to return, then an empty result
281
+ # set will be returned. Use in query `page=1`.
282
+ # @param [Integer] per_page Optional parameter: This parameter indicates how
283
+ # many records to fetch in each request. Default value is 30. The maximum
284
+ # allowed values is 200; any per_page value over 200 will be changed to 200.
285
+ # Use in query `per_page=200`.
286
+ # @param [BasicDateField] date_field Optional parameter: The field was
287
+ # deprecated: on January 20, 2022. We recommend using filter[date_field]
288
+ # instead to achieve the same result. The type of filter you would like to
289
+ # apply to your search.
290
+ # @param [Date] start_date Optional parameter: The field was deprecated: on
291
+ # January 20, 2022. We recommend using filter[start_date] instead to achieve
292
+ # the same result. The start date (format YYYY-MM-DD) with which to filter
293
+ # the date_field. Returns coupons with a timestamp at or after midnight
294
+ # (12:00:00 AM) in your site’s time zone on the date specified.
295
+ # @param [Date] end_date Optional parameter: The field was deprecated: on
296
+ # January 20, 2022. We recommend using filter[end_date] instead to achieve
297
+ # the same result. The end date (format YYYY-MM-DD) with which to filter the
298
+ # date_field. Returns coupons with a timestamp up to and including
299
+ # 11:59:59PM in your site’s time zone on the date specified.
300
+ # @param [DateTime] start_datetime Optional parameter: The field was
301
+ # deprecated: on January 20, 2022. We recommend using filter[start_datetime]
302
+ # instead to achieve the same result. The start date and time (format
303
+ # YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons
304
+ # with a timestamp at or after exact time provided in query. You can specify
305
+ # timezone in query - otherwise your site's time zone will be used. If
306
+ # provided, this parameter will be used instead of start_date.
307
+ # @param [DateTime] end_datetime Optional parameter: The field was
308
+ # deprecated: on January 20, 2022. We recommend using filter[end_datetime]
309
+ # instead to achieve the same result. The end date and time (format
310
+ # YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons
311
+ # with a timestamp at or before exact time provided in query. You can
312
+ # specify timezone in query - otherwise your site's time zone will be used.
313
+ # If provided, this parameter will be used instead of end_date.
314
+ # @param [Array[Integer]] filter_ids Optional parameter: Allows fetching
315
+ # coupons with matching id based on provided values. Use in query
316
+ # `filter[ids]=1,2,3`.
317
+ # @param [Array[String]] filter_codes Optional parameter: Allows fetching
318
+ # coupons with matching code based on provided values. Use in query
319
+ # `filter[ids]=1,2,3`.
320
+ # @param [TrueClass | FalseClass] currency_prices Optional parameter: When
321
+ # fetching coupons, if you have defined multiple currencies at the site
322
+ # level, you can optionally pass the `?currency_prices=true` query param to
323
+ # include an array of currency price data in the response. Use in query
324
+ # `currency_prices=true`.
325
+ # @param [Date] filter_end_date Optional parameter: The end date (format
326
+ # YYYY-MM-DD) with which to filter the date_field. Returns coupons with a
327
+ # timestamp up to and including 11:59:59PM in your site’s time zone on the
328
+ # date specified. Use in query `filter[end_date]=2011-12-17`.
329
+ # @param [DateTime] filter_end_datetime Optional parameter: The end date and
330
+ # time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field.
331
+ # Returns coupons with a timestamp at or before exact time provided in
332
+ # query. You can specify timezone in query - otherwise your site's time zone
333
+ # will be used. If provided, this parameter will be used instead of
334
+ # end_date. Use in query `filter[end_datetime]=2011-12-19T10:15:30+01:00`.
335
+ # @param [Date] filter_start_date Optional parameter: The start date (format
336
+ # YYYY-MM-DD) with which to filter the date_field. Returns coupons with a
337
+ # timestamp at or after midnight (12:00:00 AM) in your site’s time zone on
338
+ # the date specified. Use in query `filter[start_date]=2011-12-19`.
339
+ # @param [DateTime] filter_start_datetime Optional parameter: The start date
340
+ # and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field.
341
+ # Returns coupons with a timestamp at or after exact time provided in query.
342
+ # You can specify timezone in query - otherwise your site's time zone will
343
+ # be used. If provided, this parameter will be used instead of start_date.
344
+ # Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`.
345
+ # @param [BasicDateField] filter_date_field Optional parameter: The type of
346
+ # filter you would like to apply to your search. Use in query
347
+ # `filter[date_field]=updated_at`.
348
+ # @param [TrueClass | FalseClass] filter_use_site_exchange_rate Optional
349
+ # parameter: Allows fetching coupons with matching use_site_exchange_rate
350
+ # based on provided value. Use in query
351
+ # `filter[use_site_exchange_rate]=true`.
352
+ # @return [Array[CouponResponse]] response from the API call
353
+ def list_coupons(options = {})
354
+ new_api_call_builder
355
+ .request(new_request_builder(HttpMethodEnum::GET,
356
+ '/coupons.json',
357
+ Server::DEFAULT)
358
+ .query_param(new_parameter(options['page'], key: 'page'))
359
+ .query_param(new_parameter(options['per_page'], key: 'per_page'))
360
+ .query_param(new_parameter(options['date_field'], key: 'date_field'))
361
+ .query_param(new_parameter(options['start_date'], key: 'start_date'))
362
+ .query_param(new_parameter(options['end_date'], key: 'end_date'))
363
+ .query_param(new_parameter(options['start_datetime'], key: 'start_datetime'))
364
+ .query_param(new_parameter(options['end_datetime'], key: 'end_datetime'))
365
+ .query_param(new_parameter(options['filter_ids'], key: 'filter[ids]'))
366
+ .query_param(new_parameter(options['filter_codes'], key: 'filter[codes]'))
367
+ .query_param(new_parameter(options['currency_prices'], key: 'currency_prices'))
368
+ .query_param(new_parameter(options['filter_end_date'], key: 'filter[end_date]'))
369
+ .query_param(new_parameter(options['filter_end_datetime'], key: 'filter[end_datetime]'))
370
+ .query_param(new_parameter(options['filter_start_date'], key: 'filter[start_date]'))
371
+ .query_param(new_parameter(options['filter_start_datetime'], key: 'filter[start_datetime]'))
372
+ .query_param(new_parameter(options['filter_date_field'], key: 'filter[date_field]'))
373
+ .query_param(new_parameter(options['filter_use_site_exchange_rate'], key: 'filter[use_site_exchange_rate]'))
374
+ .header_param(new_parameter('application/json', key: 'accept'))
375
+ .auth(Single.new('global'))
376
+ .array_serialization_format(ArraySerializationFormat::CSV))
377
+ .response(new_response_handler
378
+ .deserializer(APIHelper.method(:custom_type_deserializer))
379
+ .deserialize_into(CouponResponse.method(:from_hash))
380
+ .is_response_array(true))
381
+ .execute
382
+ end
383
+
384
+ # This request will provide details about the coupon usage as an array of
385
+ # data hashes, one per product.
386
+ # @param [Integer] product_family_id Required parameter: The Chargify id of
387
+ # the product family to which the coupon belongs
388
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
389
+ # coupon
390
+ # @return [Array[CouponUsage]] response from the API call
391
+ def read_coupon_usage(product_family_id,
392
+ coupon_id)
393
+ new_api_call_builder
394
+ .request(new_request_builder(HttpMethodEnum::GET,
395
+ '/product_families/{product_family_id}/coupons/{coupon_id}/usage.json',
396
+ Server::DEFAULT)
397
+ .template_param(new_parameter(product_family_id, key: 'product_family_id')
398
+ .is_required(true)
399
+ .should_encode(true))
400
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
401
+ .is_required(true)
402
+ .should_encode(true))
403
+ .header_param(new_parameter('application/json', key: 'accept'))
404
+ .auth(Single.new('global')))
405
+ .response(new_response_handler
406
+ .deserializer(APIHelper.method(:custom_type_deserializer))
407
+ .deserialize_into(CouponUsage.method(:from_hash))
408
+ .is_response_array(true))
409
+ .execute
410
+ end
411
+
412
+ # You can verify if a specific coupon code is valid using the `validate`
413
+ # method. This method is useful for validating coupon codes that are entered
414
+ # by a customer. If the coupon is found and is valid, the coupon will be
415
+ # returned with a 200 status code.
416
+ # If the coupon is invalid, the status code will be 404 and the response
417
+ # will say why it is invalid. If the coupon is valid, the status code will
418
+ # be 200 and the coupon will be returned. The following reasons for
419
+ # invalidity are supported:
420
+ # + Coupon not found
421
+ # + Coupon is invalid
422
+ # + Coupon expired
423
+ # If you have more than one product family and if the coupon you are
424
+ # validating does not belong to the first product family in your site, then
425
+ # you will need to specify the product family, either in the url or as a
426
+ # query string param. This can be done by supplying the id or the handle in
427
+ # the `handle:my-family` format.
428
+ # Eg.
429
+ # ```
430
+ # https://<subdomain>.chargify.com/product_families/handle:<product_family_h
431
+ # andle>/coupons/validate.<format>?code=<coupon_code>
432
+ # ```
433
+ # Or:
434
+ # ```
435
+ # https://<subdomain>.chargify.com/coupons/validate.<format>?code=<coupon_co
436
+ # de>&product_family_id=<id>
437
+ # ```
438
+ # @param [String] code Required parameter: The code of the coupon
439
+ # @param [Integer] product_family_id Optional parameter: The Chargify id of
440
+ # the product family to which the coupon belongs
441
+ # @return [CouponResponse] response from the API call
442
+ def validate_coupon(code,
443
+ product_family_id: nil)
444
+ new_api_call_builder
445
+ .request(new_request_builder(HttpMethodEnum::GET,
446
+ '/coupons/validate.json',
447
+ Server::DEFAULT)
448
+ .query_param(new_parameter(code, key: 'code')
449
+ .is_required(true))
450
+ .query_param(new_parameter(product_family_id, key: 'product_family_id'))
451
+ .header_param(new_parameter('application/json', key: 'accept'))
452
+ .auth(Single.new('global')))
453
+ .response(new_response_handler
454
+ .deserializer(APIHelper.method(:custom_type_deserializer))
455
+ .deserialize_into(CouponResponse.method(:from_hash))
456
+ .local_error('404',
457
+ 'Not Found',
458
+ SingleStringErrorResponseException))
459
+ .execute
460
+ end
461
+
462
+ # This endpoint allows you to create and/or update currency prices for an
463
+ # existing coupon. Multiple prices can be created or updated in a single
464
+ # request but each of the currencies must be defined on the site level
465
+ # already and the coupon must be an amount-based coupon, not percentage.
466
+ # Currency pricing for coupons must mirror the setup of the primary coupon
467
+ # pricing - if the primary coupon is percentage based, you will not be able
468
+ # to define pricing in non-primary currencies.
469
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
470
+ # coupon
471
+ # @param [CouponCurrencyRequest] body Optional parameter: Example:
472
+ # @return [CouponCurrencyResponse] response from the API call
473
+ def create_or_update_coupon_currency_prices(coupon_id,
474
+ body: nil)
475
+ new_api_call_builder
476
+ .request(new_request_builder(HttpMethodEnum::PUT,
477
+ '/coupons/{coupon_id}/currency_prices.json',
478
+ Server::DEFAULT)
479
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
480
+ .is_required(true)
481
+ .should_encode(true))
482
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
483
+ .body_param(new_parameter(body))
484
+ .header_param(new_parameter('application/json', key: 'accept'))
485
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
486
+ .auth(Single.new('global')))
487
+ .response(new_response_handler
488
+ .deserializer(APIHelper.method(:custom_type_deserializer))
489
+ .deserialize_into(CouponCurrencyResponse.method(:from_hash)))
490
+ .execute
491
+ end
492
+
493
+ # ## Coupon Subcodes Intro
494
+ # Coupon Subcodes allow you to create a set of unique codes that allow you
495
+ # to expand the use of one coupon.
496
+ # For example:
497
+ # Master Coupon Code:
498
+ # + SPRING2020
499
+ # Coupon Subcodes:
500
+ # + SPRING90210
501
+ # + DP80302
502
+ # + SPRINGBALTIMORE
503
+ # Coupon subcodes can be administered in the Admin Interface or via the API.
504
+ # When creating a coupon subcode, you must specify a coupon to attach it to
505
+ # using the coupon_id. Valid coupon subcodes are all capital letters,
506
+ # contain only letters and numbers, and do not have any spaces. Lowercase
507
+ # letters will be capitalized before the subcode is created.
508
+ # ## Coupon Subcodes Documentation
509
+ # Full documentation on how to create coupon subcodes in the Chargify UI can
510
+ # be located
511
+ # [here](https://chargify.zendesk.com/hc/en-us/articles/4407755909531#coupon
512
+ # -codes).
513
+ # Additionally, for documentation on how to apply a coupon to a Subscription
514
+ # within the Chargify UI, please see our documentation
515
+ # [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#coupon
516
+ # ).
517
+ # ## Create Coupon Subcode
518
+ # This request allows you to create specific subcodes underneath an existing
519
+ # coupon code.
520
+ # *Note*: If you are using any of the allowed special characters ("%", "@",
521
+ # "+", "-", "_", and "."), you must encode them for use in the URL.
522
+ # % to %25
523
+ # @ to %40
524
+ # + to %2B
525
+ # - to %2D
526
+ # _ to %5F
527
+ # . to %2E
528
+ # So, if the coupon subcode is `20%OFF`, the URL to delete this coupon
529
+ # subcode would be:
530
+ # `https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>`
531
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
532
+ # coupon
533
+ # @param [CouponSubcodes] body Optional parameter: Example:
534
+ # @return [CouponSubcodesResponse] response from the API call
535
+ def create_coupon_subcodes(coupon_id,
536
+ body: nil)
537
+ new_api_call_builder
538
+ .request(new_request_builder(HttpMethodEnum::POST,
539
+ '/coupons/{coupon_id}/codes.json',
540
+ Server::DEFAULT)
541
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
542
+ .is_required(true)
543
+ .should_encode(true))
544
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
545
+ .body_param(new_parameter(body))
546
+ .header_param(new_parameter('application/json', key: 'accept'))
547
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
548
+ .auth(Single.new('global')))
549
+ .response(new_response_handler
550
+ .deserializer(APIHelper.method(:custom_type_deserializer))
551
+ .deserialize_into(CouponSubcodesResponse.method(:from_hash)))
552
+ .execute
553
+ end
554
+
555
+ # This request allows you to request the subcodes that are attached to a
556
+ # coupon.
557
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
558
+ # coupon
559
+ # @param [Integer] page Optional parameter: Result records are organized in
560
+ # pages. By default, the first page of results is displayed. The page
561
+ # parameter specifies a page number of results to fetch. You can start
562
+ # navigating through the pages to consume the results. You do this by
563
+ # passing in a page parameter. Retrieve the next page by adding ?page=2 to
564
+ # the query string. If there are no results to return, then an empty result
565
+ # set will be returned. Use in query `page=1`.
566
+ # @param [Integer] per_page Optional parameter: This parameter indicates how
567
+ # many records to fetch in each request. Default value is 20. The maximum
568
+ # allowed values is 200; any per_page value over 200 will be changed to 200.
569
+ # Use in query `per_page=200`.
570
+ # @return [CouponSubcodes] response from the API call
571
+ def list_coupon_subcodes(options = {})
572
+ new_api_call_builder
573
+ .request(new_request_builder(HttpMethodEnum::GET,
574
+ '/coupons/{coupon_id}/codes.json',
575
+ Server::DEFAULT)
576
+ .template_param(new_parameter(options['coupon_id'], key: 'coupon_id')
577
+ .is_required(true)
578
+ .should_encode(true))
579
+ .query_param(new_parameter(options['page'], key: 'page'))
580
+ .query_param(new_parameter(options['per_page'], key: 'per_page'))
581
+ .header_param(new_parameter('application/json', key: 'accept'))
582
+ .auth(Single.new('global')))
583
+ .response(new_response_handler
584
+ .deserializer(APIHelper.method(:custom_type_deserializer))
585
+ .deserialize_into(CouponSubcodes.method(:from_hash)))
586
+ .execute
587
+ end
588
+
589
+ # You can update the subcodes for the given Coupon via the API with a PUT
590
+ # request to the resource endpoint.
591
+ # Send an array of new coupon subcodes.
592
+ # **Note**: All current subcodes for that Coupon will be deleted first, and
593
+ # replaced with the list of subcodes sent to this endpoint.
594
+ # The response will contain:
595
+ # + The created subcodes,
596
+ # + Subcodes that were not created because they already exist,
597
+ # + Any subcodes not created because they are invalid.
598
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
599
+ # coupon
600
+ # @param [CouponSubcodes] body Optional parameter: Example:
601
+ # @return [CouponSubcodesResponse] response from the API call
602
+ def update_coupon_subcodes(coupon_id,
603
+ body: nil)
604
+ new_api_call_builder
605
+ .request(new_request_builder(HttpMethodEnum::PUT,
606
+ '/coupons/{coupon_id}/codes.json',
607
+ Server::DEFAULT)
608
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
609
+ .is_required(true)
610
+ .should_encode(true))
611
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
612
+ .body_param(new_parameter(body))
613
+ .header_param(new_parameter('application/json', key: 'accept'))
614
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
615
+ .auth(Single.new('global')))
616
+ .response(new_response_handler
617
+ .deserializer(APIHelper.method(:custom_type_deserializer))
618
+ .deserialize_into(CouponSubcodesResponse.method(:from_hash)))
619
+ .execute
620
+ end
621
+
622
+ # ## Example
623
+ # Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL
624
+ # to `DELETE` this coupon subcode would be:
625
+ # ```
626
+ # http://subdomain.chargify.com/coupons/567/codes/20OFF.<format>
627
+ # ```
628
+ # Note: If you are using any of the allowed special characters (“%”, “@”,
629
+ # “+”, “-”, “_”, and “.”), you must encode them for use in the URL.
630
+ # | Special character | Encoding |
631
+ # |-------------------|----------|
632
+ # | % | %25 |
633
+ # | @ | %40 |
634
+ # | + | %2B |
635
+ # | – | %2D |
636
+ # | _ | %5F |
637
+ # | . | %2E |
638
+ # ## Percent Encoding Example
639
+ # Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode
640
+ # would be:
641
+ # @https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>
642
+ # @param [Integer] coupon_id Required parameter: The Chargify id of the
643
+ # coupon to which the subcode belongs
644
+ # @param [String] subcode Required parameter: The subcode of the coupon
645
+ # @return [void] response from the API call
646
+ def delete_coupon_subcode(coupon_id,
647
+ subcode)
648
+ new_api_call_builder
649
+ .request(new_request_builder(HttpMethodEnum::DELETE,
650
+ '/coupons/{coupon_id}/codes/{subcode}.json',
651
+ Server::DEFAULT)
652
+ .template_param(new_parameter(coupon_id, key: 'coupon_id')
653
+ .is_required(true)
654
+ .should_encode(true))
655
+ .template_param(new_parameter(subcode, key: 'subcode')
656
+ .is_required(true)
657
+ .should_encode(true))
658
+ .auth(Single.new('global')))
659
+ .response(new_response_handler
660
+ .is_response_void(true)
661
+ .local_error_template('404',
662
+ 'Not Found:\'{$response.body}\'',
663
+ APIException))
664
+ .execute
665
+ end
666
+ end
667
+ end