orb-apiamtic-sdk 0.0.1

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 (659) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +177 -0
  4. data/bin/console +15 -0
  5. data/lib/api_reference/api_helper.rb +10 -0
  6. data/lib/api_reference/apis/alert_api.rb +497 -0
  7. data/lib/api_reference/apis/availability_api.rb +51 -0
  8. data/lib/api_reference/apis/base_api.rb +65 -0
  9. data/lib/api_reference/apis/coupon_api.rb +250 -0
  10. data/lib/api_reference/apis/credit_api.rb +1269 -0
  11. data/lib/api_reference/apis/credit_note_api.rb +181 -0
  12. data/lib/api_reference/apis/customer_api.rb +1058 -0
  13. data/lib/api_reference/apis/dimensional_price_group_api.rb +289 -0
  14. data/lib/api_reference/apis/event_api.rb +776 -0
  15. data/lib/api_reference/apis/invoice_api.rb +933 -0
  16. data/lib/api_reference/apis/item_api.rb +224 -0
  17. data/lib/api_reference/apis/license_api.rb +452 -0
  18. data/lib/api_reference/apis/license_type_api.rb +147 -0
  19. data/lib/api_reference/apis/metric_api.rb +211 -0
  20. data/lib/api_reference/apis/plan_api.rb +763 -0
  21. data/lib/api_reference/apis/price_api.rb +538 -0
  22. data/lib/api_reference/apis/price_interval_api.rb +134 -0
  23. data/lib/api_reference/apis/subscription_api.rb +1575 -0
  24. data/lib/api_reference/apis/subscription_change_api.rb +213 -0
  25. data/lib/api_reference/client.rb +175 -0
  26. data/lib/api_reference/configuration.rb +166 -0
  27. data/lib/api_reference/exceptions/api_exception.rb +21 -0
  28. data/lib/api_reference/exceptions/authorization_error_exception.rb +60 -0
  29. data/lib/api_reference/exceptions/idempotency_request_mismatch_exception.rb +60 -0
  30. data/lib/api_reference/exceptions/server_error_exception.rb +61 -0
  31. data/lib/api_reference/exceptions/too_many_requests_exception.rb +60 -0
  32. data/lib/api_reference/http/api_response.rb +19 -0
  33. data/lib/api_reference/http/auth/oauth_2.rb +53 -0
  34. data/lib/api_reference/http/http_call_back.rb +10 -0
  35. data/lib/api_reference/http/http_method_enum.rb +10 -0
  36. data/lib/api_reference/http/http_request.rb +10 -0
  37. data/lib/api_reference/http/http_response.rb +10 -0
  38. data/lib/api_reference/http/proxy_settings.rb +22 -0
  39. data/lib/api_reference/logging/configuration/api_logging_configuration.rb +186 -0
  40. data/lib/api_reference/logging/sdk_logger.rb +17 -0
  41. data/lib/api_reference/models/accounting_provider.rb +108 -0
  42. data/lib/api_reference/models/accounting_provider_config.rb +84 -0
  43. data/lib/api_reference/models/accounting_sync_configuration.rb +117 -0
  44. data/lib/api_reference/models/action.rb +68 -0
  45. data/lib/api_reference/models/add_adjustment_interval_params.rb +148 -0
  46. data/lib/api_reference/models/add_amendment_credit_ledger_entry_request_params.rb +144 -0
  47. data/lib/api_reference/models/add_credit_top_up_request_params.rb +149 -0
  48. data/lib/api_reference/models/add_decrement_credit_ledger_entry_request_params.rb +145 -0
  49. data/lib/api_reference/models/add_edit_price_interval_params.rb +161 -0
  50. data/lib/api_reference/models/add_expiration_change_credit_ledger_entry_request_params.rb +193 -0
  51. data/lib/api_reference/models/add_increment_credit_ledger_entry_request_params.rb +237 -0
  52. data/lib/api_reference/models/add_plan_adjustment_params.rb +90 -0
  53. data/lib/api_reference/models/add_plan_price_params.rb +103 -0
  54. data/lib/api_reference/models/add_price_interval_params.rb +297 -0
  55. data/lib/api_reference/models/add_subscription_adjustment_params.rb +146 -0
  56. data/lib/api_reference/models/add_subscription_price_params.rb +234 -0
  57. data/lib/api_reference/models/add_void_credit_ledger_entry_request_params.rb +169 -0
  58. data/lib/api_reference/models/address.rb +162 -0
  59. data/lib/api_reference/models/address_input.rb +131 -0
  60. data/lib/api_reference/models/adjustment_interval.rb +163 -0
  61. data/lib/api_reference/models/affected_block.rb +155 -0
  62. data/lib/api_reference/models/aggregated_cost.rb +131 -0
  63. data/lib/api_reference/models/alert.rb +339 -0
  64. data/lib/api_reference/models/alerts.rb +92 -0
  65. data/lib/api_reference/models/allocation.rb +157 -0
  66. data/lib/api_reference/models/amend_event_result.rb +73 -0
  67. data/lib/api_reference/models/amended_event.rb +115 -0
  68. data/lib/api_reference/models/amendment_ledger_entry.rb +301 -0
  69. data/lib/api_reference/models/amount_discount.rb +150 -0
  70. data/lib/api_reference/models/amount_discount_creation_params.rb +81 -0
  71. data/lib/api_reference/models/amount_discount_interval.rb +187 -0
  72. data/lib/api_reference/models/api_pagination_params.rb +74 -0
  73. data/lib/api_reference/models/apply_params.rb +136 -0
  74. data/lib/api_reference/models/auto_collection.rb +157 -0
  75. data/lib/api_reference/models/backfill.rb +214 -0
  76. data/lib/api_reference/models/backfill_status.rb +44 -0
  77. data/lib/api_reference/models/backfills.rb +92 -0
  78. data/lib/api_reference/models/balance_alert_status.rb +105 -0
  79. data/lib/api_reference/models/base_model.rb +110 -0
  80. data/lib/api_reference/models/billable_metric.rb +155 -0
  81. data/lib/api_reference/models/billable_metric_minified.rb +86 -0
  82. data/lib/api_reference/models/billable_metric_simple.rb +104 -0
  83. data/lib/api_reference/models/billable_metric_tiny.rb +86 -0
  84. data/lib/api_reference/models/billable_metrics.rb +92 -0
  85. data/lib/api_reference/models/billing_cycle_alignment.rb +40 -0
  86. data/lib/api_reference/models/billing_cycle_anchor_configuration.rb +117 -0
  87. data/lib/api_reference/models/billing_cycle_configuration.rb +104 -0
  88. data/lib/api_reference/models/billing_mode.rb +36 -0
  89. data/lib/api_reference/models/block_price_filter.rb +114 -0
  90. data/lib/api_reference/models/bulk_config.rb +87 -0
  91. data/lib/api_reference/models/bulk_price.rb +584 -0
  92. data/lib/api_reference/models/bulk_tier.rb +87 -0
  93. data/lib/api_reference/models/bulk_tier_with_proration.rb +88 -0
  94. data/lib/api_reference/models/bulk_with_filters_config.rb +98 -0
  95. data/lib/api_reference/models/bulk_with_filters_config1.rb +116 -0
  96. data/lib/api_reference/models/bulk_with_filters_price.rb +587 -0
  97. data/lib/api_reference/models/bulk_with_filters_tier.rb +88 -0
  98. data/lib/api_reference/models/bulk_with_proration_config.rb +69 -0
  99. data/lib/api_reference/models/bulk_with_proration_config1.rb +87 -0
  100. data/lib/api_reference/models/bulk_with_proration_price.rb +587 -0
  101. data/lib/api_reference/models/cadence.rb +52 -0
  102. data/lib/api_reference/models/cadence104.rb +52 -0
  103. data/lib/api_reference/models/cadence34.rb +48 -0
  104. data/lib/api_reference/models/cancel_option.rb +40 -0
  105. data/lib/api_reference/models/cancel_subscription_params.rb +102 -0
  106. data/lib/api_reference/models/change_option.rb +42 -0
  107. data/lib/api_reference/models/change_option1.rb +40 -0
  108. data/lib/api_reference/models/changed_subscription_resources.rb +185 -0
  109. data/lib/api_reference/models/constraint_violation_error.rb +101 -0
  110. data/lib/api_reference/models/conversion_rate_tier.rb +82 -0
  111. data/lib/api_reference/models/conversion_rate_tiered_config.rb +69 -0
  112. data/lib/api_reference/models/conversion_rate_unit_config.rb +60 -0
  113. data/lib/api_reference/models/costs_request_params.rb +118 -0
  114. data/lib/api_reference/models/country.rb +492 -0
  115. data/lib/api_reference/models/coupon.rb +195 -0
  116. data/lib/api_reference/models/coupon_query_params.rb +99 -0
  117. data/lib/api_reference/models/coupon_redemption.rb +132 -0
  118. data/lib/api_reference/models/coupons.rb +92 -0
  119. data/lib/api_reference/models/create_credit_note_params.rb +120 -0
  120. data/lib/api_reference/models/create_customer_alert_request_params.rb +91 -0
  121. data/lib/api_reference/models/create_invoice_line_item_params.rb +128 -0
  122. data/lib/api_reference/models/create_one_off_invoice_params.rb +255 -0
  123. data/lib/api_reference/models/create_subscription_alert_request_params.rb +163 -0
  124. data/lib/api_reference/models/created_invoice.rb +851 -0
  125. data/lib/api_reference/models/credit_block.rb +231 -0
  126. data/lib/api_reference/models/credit_block_allocation.rb +140 -0
  127. data/lib/api_reference/models/credit_block_expiry_ledger_entry.rb +301 -0
  128. data/lib/api_reference/models/credit_block_invoices_response.rb +91 -0
  129. data/lib/api_reference/models/credit_block_source.rb +43 -0
  130. data/lib/api_reference/models/credit_ledger_entries.rb +109 -0
  131. data/lib/api_reference/models/credit_note.rb +338 -0
  132. data/lib/api_reference/models/credit_note_discount.rb +152 -0
  133. data/lib/api_reference/models/credit_note_discount_applies_to_price.rb +104 -0
  134. data/lib/api_reference/models/credit_note_line_item.rb +244 -0
  135. data/lib/api_reference/models/credit_note_line_item_discount.rb +173 -0
  136. data/lib/api_reference/models/credit_note_line_item_params.rb +116 -0
  137. data/lib/api_reference/models/credit_note_summary.rb +181 -0
  138. data/lib/api_reference/models/credit_note_tiny.rb +86 -0
  139. data/lib/api_reference/models/credit_notes.rb +92 -0
  140. data/lib/api_reference/models/cumulative_grouped_allocation_config.rb +94 -0
  141. data/lib/api_reference/models/cumulative_grouped_allocation_config1.rb +120 -0
  142. data/lib/api_reference/models/cumulative_grouped_allocation_price.rb +588 -0
  143. data/lib/api_reference/models/cumulative_grouped_bulk_config.rb +77 -0
  144. data/lib/api_reference/models/cumulative_grouped_bulk_config1.rb +103 -0
  145. data/lib/api_reference/models/cumulative_grouped_bulk_dimension_value.rb +105 -0
  146. data/lib/api_reference/models/cumulative_grouped_bulk_price.rb +588 -0
  147. data/lib/api_reference/models/custom_expiration.rb +104 -0
  148. data/lib/api_reference/models/customer.rb +511 -0
  149. data/lib/api_reference/models/customer_balance_transaction.rb +226 -0
  150. data/lib/api_reference/models/customer_balance_transactions.rb +92 -0
  151. data/lib/api_reference/models/customer_costs.rb +81 -0
  152. data/lib/api_reference/models/customer_credit_balance.rb +231 -0
  153. data/lib/api_reference/models/customer_credit_balances.rb +92 -0
  154. data/lib/api_reference/models/customer_hierarchy.rb +93 -0
  155. data/lib/api_reference/models/customer_hierarchy2.rb +121 -0
  156. data/lib/api_reference/models/customer_hierarchy_config.rb +92 -0
  157. data/lib/api_reference/models/customer_minified.rb +107 -0
  158. data/lib/api_reference/models/customer_tax_id.rb +224 -0
  159. data/lib/api_reference/models/customers.rb +92 -0
  160. data/lib/api_reference/models/daily_credit_allowance_config.rb +119 -0
  161. data/lib/api_reference/models/daily_credit_allowance_config1.rb +150 -0
  162. data/lib/api_reference/models/daily_credit_allowance_matrix_value.rb +93 -0
  163. data/lib/api_reference/models/daily_credit_allowance_price.rb +588 -0
  164. data/lib/api_reference/models/date_type.rb +36 -0
  165. data/lib/api_reference/models/deactivate_license.rb +65 -0
  166. data/lib/api_reference/models/debug.rb +82 -0
  167. data/lib/api_reference/models/decrement_ledger_entry.rb +342 -0
  168. data/lib/api_reference/models/deprecated_event_result.rb +74 -0
  169. data/lib/api_reference/models/dimensional_price_configuration.rb +108 -0
  170. data/lib/api_reference/models/dimensional_price_group.rb +134 -0
  171. data/lib/api_reference/models/dimensional_price_groups.rb +92 -0
  172. data/lib/api_reference/models/discount_override.rb +116 -0
  173. data/lib/api_reference/models/discount_type.rb +40 -0
  174. data/lib/api_reference/models/discount_type1.rb +36 -0
  175. data/lib/api_reference/models/duplicate_resource_creation_error.rb +101 -0
  176. data/lib/api_reference/models/duration_unit.rb +36 -0
  177. data/lib/api_reference/models/duration_unit1.rb +36 -0
  178. data/lib/api_reference/models/duration_unit3.rb +48 -0
  179. data/lib/api_reference/models/edit_adjustment_interval_params.rb +130 -0
  180. data/lib/api_reference/models/edit_customer.rb +351 -0
  181. data/lib/api_reference/models/edit_dimensional_price_group.rb +86 -0
  182. data/lib/api_reference/models/edit_plan.rb +91 -0
  183. data/lib/api_reference/models/edit_price_interval_params.rb +237 -0
  184. data/lib/api_reference/models/effective_time.rb +26 -0
  185. data/lib/api_reference/models/end_of_term.rb +26 -0
  186. data/lib/api_reference/models/entry_status.rb +36 -0
  187. data/lib/api_reference/models/entry_type.rb +56 -0
  188. data/lib/api_reference/models/evaluate_multiple_price_resource.rb +81 -0
  189. data/lib/api_reference/models/evaluate_multiple_prices_body.rb +129 -0
  190. data/lib/api_reference/models/evaluate_multiple_prices_with_preview_events_body.rb +148 -0
  191. data/lib/api_reference/models/evaluate_price_body.rb +153 -0
  192. data/lib/api_reference/models/evaluate_price_group.rb +120 -0
  193. data/lib/api_reference/models/evaluate_price_resource.rb +81 -0
  194. data/lib/api_reference/models/evaluate_price_resource_for_multiple_price.rb +130 -0
  195. data/lib/api_reference/models/event.rb +149 -0
  196. data/lib/api_reference/models/event_output_config.rb +90 -0
  197. data/lib/api_reference/models/event_output_config1.rb +104 -0
  198. data/lib/api_reference/models/event_output_price.rb +585 -0
  199. data/lib/api_reference/models/event_search_criteria.rb +106 -0
  200. data/lib/api_reference/models/event_volume.rb +107 -0
  201. data/lib/api_reference/models/event_volume_params.rb +115 -0
  202. data/lib/api_reference/models/event_volumes.rb +81 -0
  203. data/lib/api_reference/models/events.rb +81 -0
  204. data/lib/api_reference/models/expiration_change_ledger_entry.rb +324 -0
  205. data/lib/api_reference/models/expires_after_unit.rb +36 -0
  206. data/lib/api_reference/models/external_connection_name.rb +44 -0
  207. data/lib/api_reference/models/external_connection_name1.rb +48 -0
  208. data/lib/api_reference/models/external_marketplace.rb +40 -0
  209. data/lib/api_reference/models/feature_not_available_error.rb +101 -0
  210. data/lib/api_reference/models/fetch_customer_credit_blocks_query_params.rb +181 -0
  211. data/lib/api_reference/models/fetch_customer_credit_ledger_query_params.rb +198 -0
  212. data/lib/api_reference/models/fetch_license_by_external_id.rb +72 -0
  213. data/lib/api_reference/models/fetch_subscription_schedule_query_params.rb +157 -0
  214. data/lib/api_reference/models/fetch_upcoming_invoice_params.rb +61 -0
  215. data/lib/api_reference/models/field.rb +48 -0
  216. data/lib/api_reference/models/filter_rule.rb +92 -0
  217. data/lib/api_reference/models/fixed_fee_quantity_change.rb +116 -0
  218. data/lib/api_reference/models/fixed_fee_quantity_schedule_entry.rb +145 -0
  219. data/lib/api_reference/models/fixed_fee_quantity_transition.rb +124 -0
  220. data/lib/api_reference/models/granularity.rb +26 -0
  221. data/lib/api_reference/models/grouped_allocation_config.rb +79 -0
  222. data/lib/api_reference/models/grouped_allocation_config1.rb +105 -0
  223. data/lib/api_reference/models/grouped_allocation_price.rb +587 -0
  224. data/lib/api_reference/models/grouped_subscription_usage.rb +114 -0
  225. data/lib/api_reference/models/grouped_subscription_usage_record.rb +149 -0
  226. data/lib/api_reference/models/grouped_tiered_config.rb +78 -0
  227. data/lib/api_reference/models/grouped_tiered_config1.rb +104 -0
  228. data/lib/api_reference/models/grouped_tiered_package_price.rb +588 -0
  229. data/lib/api_reference/models/grouped_tiered_package_pricing_config.rb +89 -0
  230. data/lib/api_reference/models/grouped_tiered_package_pricing_config1.rb +119 -0
  231. data/lib/api_reference/models/grouped_tiered_package_tier_item.rb +92 -0
  232. data/lib/api_reference/models/grouped_tiered_price.rb +586 -0
  233. data/lib/api_reference/models/grouped_tiered_tier.rb +92 -0
  234. data/lib/api_reference/models/grouped_with_metered_minimum_config.rb +127 -0
  235. data/lib/api_reference/models/grouped_with_metered_minimum_config1.rb +173 -0
  236. data/lib/api_reference/models/grouped_with_metered_minimum_price.rb +588 -0
  237. data/lib/api_reference/models/grouped_with_metered_minimum_scaling_factor_item.rb +92 -0
  238. data/lib/api_reference/models/grouped_with_metered_minimum_unit_amount_item.rb +91 -0
  239. data/lib/api_reference/models/grouped_with_min_max_thresholds_config.rb +90 -0
  240. data/lib/api_reference/models/grouped_with_min_max_thresholds_config1.rb +120 -0
  241. data/lib/api_reference/models/grouped_with_min_max_thresholds_price.rb +588 -0
  242. data/lib/api_reference/models/grouped_with_prorated_minimum_config.rb +78 -0
  243. data/lib/api_reference/models/grouped_with_prorated_minimum_config1.rb +104 -0
  244. data/lib/api_reference/models/grouped_with_prorated_minimum_price.rb +588 -0
  245. data/lib/api_reference/models/increment_credit_ledger_entry_invoice_settings.rb +197 -0
  246. data/lib/api_reference/models/increment_ledger_entry.rb +322 -0
  247. data/lib/api_reference/models/ingest_event.rb +127 -0
  248. data/lib/api_reference/models/ingest_event_idempotency_key_only.rb +75 -0
  249. data/lib/api_reference/models/ingest_query_params.rb +75 -0
  250. data/lib/api_reference/models/ingest_request_body.rb +69 -0
  251. data/lib/api_reference/models/ingestion_response.rb +97 -0
  252. data/lib/api_reference/models/invoice.rb +843 -0
  253. data/lib/api_reference/models/invoice_line_item.rb +359 -0
  254. data/lib/api_reference/models/invoice_line_item_params.rb +157 -0
  255. data/lib/api_reference/models/invoice_minified.rb +112 -0
  256. data/lib/api_reference/models/invoice_source.rb +40 -0
  257. data/lib/api_reference/models/invoice_summary.rb +525 -0
  258. data/lib/api_reference/models/invoice_summarys.rb +92 -0
  259. data/lib/api_reference/models/invoice_tiny.rb +86 -0
  260. data/lib/api_reference/models/invoices.rb +92 -0
  261. data/lib/api_reference/models/issue_invoice_request_params.rb +66 -0
  262. data/lib/api_reference/models/item.rb +154 -0
  263. data/lib/api_reference/models/item_external_connection.rb +110 -0
  264. data/lib/api_reference/models/item_slim.rb +105 -0
  265. data/lib/api_reference/models/items.rb +92 -0
  266. data/lib/api_reference/models/license_api_resource.rb +147 -0
  267. data/lib/api_reference/models/license_api_resources.rb +92 -0
  268. data/lib/api_reference/models/license_type.rb +119 -0
  269. data/lib/api_reference/models/license_type_minified.rb +86 -0
  270. data/lib/api_reference/models/license_types.rb +92 -0
  271. data/lib/api_reference/models/license_usage.rb +203 -0
  272. data/lib/api_reference/models/license_usage_by_external_id_query_params.rb +133 -0
  273. data/lib/api_reference/models/license_usage_by_type_query_params.rb +132 -0
  274. data/lib/api_reference/models/license_usage_query_params.rb +110 -0
  275. data/lib/api_reference/models/license_usages.rb +92 -0
  276. data/lib/api_reference/models/list_alerts_query_params.rb +189 -0
  277. data/lib/api_reference/models/list_credit_notes_params.rb +157 -0
  278. data/lib/api_reference/models/list_customer_balance_transactions_query_params.rb +158 -0
  279. data/lib/api_reference/models/list_customers_query_params.rb +157 -0
  280. data/lib/api_reference/models/list_invoices_params.rb +345 -0
  281. data/lib/api_reference/models/list_licenses_params.rb +125 -0
  282. data/lib/api_reference/models/list_metrics_query_params.rb +157 -0
  283. data/lib/api_reference/models/list_plans_query_params.rb +163 -0
  284. data/lib/api_reference/models/list_subscription_changes_query_params.rb +112 -0
  285. data/lib/api_reference/models/list_subscriptions_query_params.rb +258 -0
  286. data/lib/api_reference/models/map_item_request_params.rb +103 -0
  287. data/lib/api_reference/models/mark_as_paid_request_params.rb +85 -0
  288. data/lib/api_reference/models/matrix_cell.rb +108 -0
  289. data/lib/api_reference/models/matrix_config.rb +119 -0
  290. data/lib/api_reference/models/matrix_price.rb +584 -0
  291. data/lib/api_reference/models/matrix_sub_line_item.rb +173 -0
  292. data/lib/api_reference/models/matrix_value.rb +92 -0
  293. data/lib/api_reference/models/matrix_with_allocation_config.rb +99 -0
  294. data/lib/api_reference/models/matrix_with_allocation_config1.rb +133 -0
  295. data/lib/api_reference/models/matrix_with_allocation_price.rb +588 -0
  296. data/lib/api_reference/models/matrix_with_allocation_value_item.rb +94 -0
  297. data/lib/api_reference/models/matrix_with_display_name_config.rb +77 -0
  298. data/lib/api_reference/models/matrix_with_display_name_config1.rb +103 -0
  299. data/lib/api_reference/models/matrix_with_display_name_price.rb +588 -0
  300. data/lib/api_reference/models/matrix_with_display_name_unit_amount_item.rb +105 -0
  301. data/lib/api_reference/models/matrix_with_threshold_discounts_config.rb +130 -0
  302. data/lib/api_reference/models/matrix_with_threshold_discounts_config1.rb +157 -0
  303. data/lib/api_reference/models/matrix_with_threshold_discounts_price.rb +588 -0
  304. data/lib/api_reference/models/max_group_tiered_package_config.rb +90 -0
  305. data/lib/api_reference/models/max_group_tiered_package_config1.rb +120 -0
  306. data/lib/api_reference/models/max_group_tiered_package_price.rb +588 -0
  307. data/lib/api_reference/models/max_group_tiered_tier_item.rb +92 -0
  308. data/lib/api_reference/models/maximum.rb +135 -0
  309. data/lib/api_reference/models/maximum_interval.rb +177 -0
  310. data/lib/api_reference/models/metered_allowance_config.rb +130 -0
  311. data/lib/api_reference/models/metered_allowance_config1.rb +152 -0
  312. data/lib/api_reference/models/metered_allowance_price.rb +587 -0
  313. data/lib/api_reference/models/metric_group.rb +105 -0
  314. data/lib/api_reference/models/minimum.rb +135 -0
  315. data/lib/api_reference/models/minimum_composite_config.rb +73 -0
  316. data/lib/api_reference/models/minimum_composite_config1.rb +87 -0
  317. data/lib/api_reference/models/minimum_composite_price.rb +587 -0
  318. data/lib/api_reference/models/minimum_interval.rb +177 -0
  319. data/lib/api_reference/models/monetary_amount_discount_adjustment.rb +219 -0
  320. data/lib/api_reference/models/monetary_maximum_adjustment.rb +218 -0
  321. data/lib/api_reference/models/monetary_minimum_adjustment.rb +231 -0
  322. data/lib/api_reference/models/monetary_percentage_discount_adjustment.rb +219 -0
  323. data/lib/api_reference/models/monetary_tiered_percentage_discount_adjustment.rb +230 -0
  324. data/lib/api_reference/models/monetary_usage_discount_adjustment.rb +218 -0
  325. data/lib/api_reference/models/mutated_subscription.rb +683 -0
  326. data/lib/api_reference/models/new_accounting_sync_configuration.rb +98 -0
  327. data/lib/api_reference/models/new_allocation_price.rb +221 -0
  328. data/lib/api_reference/models/new_amount_discount.rb +202 -0
  329. data/lib/api_reference/models/new_anrok_configuration.rb +100 -0
  330. data/lib/api_reference/models/new_avalara_tax_configuration.rb +114 -0
  331. data/lib/api_reference/models/new_backfill.rb +165 -0
  332. data/lib/api_reference/models/new_billable_metric.rb +101 -0
  333. data/lib/api_reference/models/new_billing_cycle_configuration.rb +104 -0
  334. data/lib/api_reference/models/new_coupon.rb +123 -0
  335. data/lib/api_reference/models/new_coupon_amount_discount.rb +103 -0
  336. data/lib/api_reference/models/new_coupon_percentage_discount.rb +103 -0
  337. data/lib/api_reference/models/new_customer.rb +333 -0
  338. data/lib/api_reference/models/new_customer_balance_transaction.rb +81 -0
  339. data/lib/api_reference/models/new_dimensional_price_configuration.rb +126 -0
  340. data/lib/api_reference/models/new_dimensional_price_group.rb +115 -0
  341. data/lib/api_reference/models/new_floating_bulk_price.rb +333 -0
  342. data/lib/api_reference/models/new_floating_bulk_with_filters_price.rb +336 -0
  343. data/lib/api_reference/models/new_floating_bulk_with_proration_price.rb +336 -0
  344. data/lib/api_reference/models/new_floating_cumulative_grouped_allocation_price.rb +337 -0
  345. data/lib/api_reference/models/new_floating_cumulative_grouped_bulk_price.rb +337 -0
  346. data/lib/api_reference/models/new_floating_daily_credit_allowance_price.rb +337 -0
  347. data/lib/api_reference/models/new_floating_event_output_price.rb +334 -0
  348. data/lib/api_reference/models/new_floating_grouped_allocation_price.rb +336 -0
  349. data/lib/api_reference/models/new_floating_grouped_tiered_package_price.rb +337 -0
  350. data/lib/api_reference/models/new_floating_grouped_tiered_price.rb +335 -0
  351. data/lib/api_reference/models/new_floating_grouped_with_metered_minimum_price.rb +337 -0
  352. data/lib/api_reference/models/new_floating_grouped_with_min_max_thresholds_price.rb +337 -0
  353. data/lib/api_reference/models/new_floating_grouped_with_prorated_minimum_price.rb +337 -0
  354. data/lib/api_reference/models/new_floating_matrix_price.rb +333 -0
  355. data/lib/api_reference/models/new_floating_matrix_with_allocation_price.rb +337 -0
  356. data/lib/api_reference/models/new_floating_matrix_with_display_name_price.rb +337 -0
  357. data/lib/api_reference/models/new_floating_matrix_with_threshold_discounts_price.rb +337 -0
  358. data/lib/api_reference/models/new_floating_max_group_tiered_package_price.rb +337 -0
  359. data/lib/api_reference/models/new_floating_metered_allowance_price.rb +336 -0
  360. data/lib/api_reference/models/new_floating_minimum_composite_price.rb +336 -0
  361. data/lib/api_reference/models/new_floating_package_price.rb +333 -0
  362. data/lib/api_reference/models/new_floating_package_with_allocation_price.rb +337 -0
  363. data/lib/api_reference/models/new_floating_percent_composite_price.rb +334 -0
  364. data/lib/api_reference/models/new_floating_scalable_matrix_with_tiered_pricing_price.rb +338 -0
  365. data/lib/api_reference/models/new_floating_scalable_matrix_with_unit_pricing_price.rb +338 -0
  366. data/lib/api_reference/models/new_floating_threshold_total_amount_price.rb +337 -0
  367. data/lib/api_reference/models/new_floating_tiered_package_price.rb +336 -0
  368. data/lib/api_reference/models/new_floating_tiered_package_with_minimum_price.rb +337 -0
  369. data/lib/api_reference/models/new_floating_tiered_price.rb +333 -0
  370. data/lib/api_reference/models/new_floating_tiered_with_minimum_price.rb +336 -0
  371. data/lib/api_reference/models/new_floating_tiered_with_proration_price.rb +336 -0
  372. data/lib/api_reference/models/new_floating_unit_price.rb +333 -0
  373. data/lib/api_reference/models/new_floating_unit_with_percent_price.rb +336 -0
  374. data/lib/api_reference/models/new_floating_unit_with_proration_price.rb +336 -0
  375. data/lib/api_reference/models/new_item.rb +74 -0
  376. data/lib/api_reference/models/new_license.rb +108 -0
  377. data/lib/api_reference/models/new_license_allocation.rb +97 -0
  378. data/lib/api_reference/models/new_license_allocation_unit_price.rb +330 -0
  379. data/lib/api_reference/models/new_license_type.rb +69 -0
  380. data/lib/api_reference/models/new_license_type_configuration.rb +78 -0
  381. data/lib/api_reference/models/new_maximum.rb +202 -0
  382. data/lib/api_reference/models/new_minimum.rb +215 -0
  383. data/lib/api_reference/models/new_numeral_configuration.rb +100 -0
  384. data/lib/api_reference/models/new_percentage_discount.rb +202 -0
  385. data/lib/api_reference/models/new_plan.rb +210 -0
  386. data/lib/api_reference/models/new_plan_bulk_price.rb +310 -0
  387. data/lib/api_reference/models/new_plan_bulk_with_filters_price.rb +313 -0
  388. data/lib/api_reference/models/new_plan_bulk_with_proration_price.rb +313 -0
  389. data/lib/api_reference/models/new_plan_cumulative_grouped_allocation_price.rb +314 -0
  390. data/lib/api_reference/models/new_plan_cumulative_grouped_bulk_price.rb +314 -0
  391. data/lib/api_reference/models/new_plan_daily_credit_allowance_price.rb +314 -0
  392. data/lib/api_reference/models/new_plan_event_output_price.rb +311 -0
  393. data/lib/api_reference/models/new_plan_grouped_allocation_price.rb +313 -0
  394. data/lib/api_reference/models/new_plan_grouped_tiered_package_price.rb +314 -0
  395. data/lib/api_reference/models/new_plan_grouped_tiered_price.rb +312 -0
  396. data/lib/api_reference/models/new_plan_grouped_with_metered_minimum_price.rb +314 -0
  397. data/lib/api_reference/models/new_plan_grouped_with_min_max_thresholds_price.rb +314 -0
  398. data/lib/api_reference/models/new_plan_grouped_with_prorated_minimum_price.rb +314 -0
  399. data/lib/api_reference/models/new_plan_matrix_price.rb +310 -0
  400. data/lib/api_reference/models/new_plan_matrix_with_allocation_price.rb +314 -0
  401. data/lib/api_reference/models/new_plan_matrix_with_display_name_price.rb +314 -0
  402. data/lib/api_reference/models/new_plan_matrix_with_threshold_discounts_price.rb +314 -0
  403. data/lib/api_reference/models/new_plan_max_group_tiered_package_price.rb +314 -0
  404. data/lib/api_reference/models/new_plan_metered_allowance_price.rb +313 -0
  405. data/lib/api_reference/models/new_plan_minimum_composite_price.rb +313 -0
  406. data/lib/api_reference/models/new_plan_package_price.rb +310 -0
  407. data/lib/api_reference/models/new_plan_package_with_allocation_price.rb +314 -0
  408. data/lib/api_reference/models/new_plan_percent_composite_price.rb +311 -0
  409. data/lib/api_reference/models/new_plan_phase.rb +104 -0
  410. data/lib/api_reference/models/new_plan_scalable_matrix_with_tiered_pricing_price.rb +315 -0
  411. data/lib/api_reference/models/new_plan_scalable_matrix_with_unit_pricing_price.rb +315 -0
  412. data/lib/api_reference/models/new_plan_threshold_total_amount_price.rb +314 -0
  413. data/lib/api_reference/models/new_plan_tiered_package_price.rb +313 -0
  414. data/lib/api_reference/models/new_plan_tiered_package_with_minimum_price.rb +314 -0
  415. data/lib/api_reference/models/new_plan_tiered_price.rb +310 -0
  416. data/lib/api_reference/models/new_plan_tiered_with_minimum_price.rb +313 -0
  417. data/lib/api_reference/models/new_plan_tiered_with_proration_price.rb +313 -0
  418. data/lib/api_reference/models/new_plan_unit_price.rb +310 -0
  419. data/lib/api_reference/models/new_plan_unit_with_percent_price.rb +313 -0
  420. data/lib/api_reference/models/new_plan_unit_with_proration_price.rb +313 -0
  421. data/lib/api_reference/models/new_plan_version.rb +197 -0
  422. data/lib/api_reference/models/new_portal_session.rb +78 -0
  423. data/lib/api_reference/models/new_reporting_configuration.rb +73 -0
  424. data/lib/api_reference/models/new_sphere_configuration.rb +100 -0
  425. data/lib/api_reference/models/new_stripe_tax_configuration.rb +100 -0
  426. data/lib/api_reference/models/new_subscription.rb +603 -0
  427. data/lib/api_reference/models/new_subscription_bulk_price.rb +310 -0
  428. data/lib/api_reference/models/new_subscription_bulk_with_filters_price.rb +313 -0
  429. data/lib/api_reference/models/new_subscription_bulk_with_proration_price.rb +313 -0
  430. data/lib/api_reference/models/new_subscription_cumulative_grouped_allocation_price.rb +314 -0
  431. data/lib/api_reference/models/new_subscription_cumulative_grouped_bulk_price.rb +314 -0
  432. data/lib/api_reference/models/new_subscription_daily_credit_allowance_price.rb +314 -0
  433. data/lib/api_reference/models/new_subscription_event_output_price.rb +311 -0
  434. data/lib/api_reference/models/new_subscription_grouped_allocation_price.rb +313 -0
  435. data/lib/api_reference/models/new_subscription_grouped_tiered_package_price.rb +314 -0
  436. data/lib/api_reference/models/new_subscription_grouped_tiered_price.rb +312 -0
  437. data/lib/api_reference/models/new_subscription_grouped_with_metered_minimum_price.rb +314 -0
  438. data/lib/api_reference/models/new_subscription_grouped_with_min_max_thresholds_price.rb +314 -0
  439. data/lib/api_reference/models/new_subscription_grouped_with_prorated_minimum_price.rb +314 -0
  440. data/lib/api_reference/models/new_subscription_matrix_price.rb +310 -0
  441. data/lib/api_reference/models/new_subscription_matrix_with_allocation_price.rb +314 -0
  442. data/lib/api_reference/models/new_subscription_matrix_with_display_name_price.rb +314 -0
  443. data/lib/api_reference/models/new_subscription_matrix_with_threshold_discounts_price.rb +314 -0
  444. data/lib/api_reference/models/new_subscription_max_group_tiered_package_price.rb +314 -0
  445. data/lib/api_reference/models/new_subscription_metered_allowance_price.rb +313 -0
  446. data/lib/api_reference/models/new_subscription_minimum_composite_price.rb +313 -0
  447. data/lib/api_reference/models/new_subscription_package_price.rb +310 -0
  448. data/lib/api_reference/models/new_subscription_package_with_allocation_price.rb +314 -0
  449. data/lib/api_reference/models/new_subscription_percent_composite_price.rb +311 -0
  450. data/lib/api_reference/models/new_subscription_scalable_matrix_with_tiered_pricing_price.rb +315 -0
  451. data/lib/api_reference/models/new_subscription_scalable_matrix_with_unit_pricing_price.rb +315 -0
  452. data/lib/api_reference/models/new_subscription_threshold_total_amount_price.rb +314 -0
  453. data/lib/api_reference/models/new_subscription_tiered_package_price.rb +313 -0
  454. data/lib/api_reference/models/new_subscription_tiered_package_with_minimum_price.rb +314 -0
  455. data/lib/api_reference/models/new_subscription_tiered_price.rb +310 -0
  456. data/lib/api_reference/models/new_subscription_tiered_with_minimum_price.rb +313 -0
  457. data/lib/api_reference/models/new_subscription_tiered_with_proration_price.rb +313 -0
  458. data/lib/api_reference/models/new_subscription_unit_price.rb +310 -0
  459. data/lib/api_reference/models/new_subscription_unit_with_percent_price.rb +313 -0
  460. data/lib/api_reference/models/new_subscription_unit_with_proration_price.rb +313 -0
  461. data/lib/api_reference/models/new_tax_jar_configuration.rb +100 -0
  462. data/lib/api_reference/models/new_tiered_percentage_discount.rb +214 -0
  463. data/lib/api_reference/models/new_tiered_percentage_discount_tier.rb +118 -0
  464. data/lib/api_reference/models/new_top_up_invoice_settings.rb +117 -0
  465. data/lib/api_reference/models/new_top_up_invoice_settings2.rb +117 -0
  466. data/lib/api_reference/models/new_usage_discount.rb +202 -0
  467. data/lib/api_reference/models/operator.rb +36 -0
  468. data/lib/api_reference/models/other_sub_line_item.rb +144 -0
  469. data/lib/api_reference/models/package_config.rb +93 -0
  470. data/lib/api_reference/models/package_price.rb +584 -0
  471. data/lib/api_reference/models/package_with_allocation_config.rb +79 -0
  472. data/lib/api_reference/models/package_with_allocation_config1.rb +105 -0
  473. data/lib/api_reference/models/package_with_allocation_price.rb +588 -0
  474. data/lib/api_reference/models/pagination_metadata.rb +106 -0
  475. data/lib/api_reference/models/pay_invoice_params.rb +62 -0
  476. data/lib/api_reference/models/payment_attempt.rb +184 -0
  477. data/lib/api_reference/models/payment_configuration.rb +95 -0
  478. data/lib/api_reference/models/payment_configuration_item.rb +126 -0
  479. data/lib/api_reference/models/payment_method.rb +188 -0
  480. data/lib/api_reference/models/payment_method_type.rb +49 -0
  481. data/lib/api_reference/models/payment_provider.rb +36 -0
  482. data/lib/api_reference/models/payment_provider1.rb +52 -0
  483. data/lib/api_reference/models/per_price_cost.rb +145 -0
  484. data/lib/api_reference/models/percent_composite_config.rb +109 -0
  485. data/lib/api_reference/models/percent_composite_config1.rb +112 -0
  486. data/lib/api_reference/models/percent_composite_price.rb +585 -0
  487. data/lib/api_reference/models/percentage_discount.rb +151 -0
  488. data/lib/api_reference/models/percentage_discount_creation_params.rb +104 -0
  489. data/lib/api_reference/models/percentage_discount_interval.rb +188 -0
  490. data/lib/api_reference/models/percentage_tier.rb +122 -0
  491. data/lib/api_reference/models/ping_response.rb +73 -0
  492. data/lib/api_reference/models/plan.rb +501 -0
  493. data/lib/api_reference/models/plan_minified.rb +125 -0
  494. data/lib/api_reference/models/plan_minified_with_version.rb +141 -0
  495. data/lib/api_reference/models/plan_phase.rb +244 -0
  496. data/lib/api_reference/models/plan_phase_amount_discount_adjustment.rb +221 -0
  497. data/lib/api_reference/models/plan_phase_maximum_adjustment.rb +221 -0
  498. data/lib/api_reference/models/plan_phase_minimum_adjustment.rb +233 -0
  499. data/lib/api_reference/models/plan_phase_percentage_discount_adjustment.rb +221 -0
  500. data/lib/api_reference/models/plan_phase_tiered_percentage_discount_adjustment.rb +233 -0
  501. data/lib/api_reference/models/plan_phase_usage_discount_adjustment.rb +221 -0
  502. data/lib/api_reference/models/plan_version.rb +172 -0
  503. data/lib/api_reference/models/plan_version_change.rb +143 -0
  504. data/lib/api_reference/models/plan_version_changes.rb +92 -0
  505. data/lib/api_reference/models/plan_version_phase.rb +163 -0
  506. data/lib/api_reference/models/plans.rb +92 -0
  507. data/lib/api_reference/models/portal_session.rb +124 -0
  508. data/lib/api_reference/models/preview_event.rb +115 -0
  509. data/lib/api_reference/models/price_evaluation_request.rb +157 -0
  510. data/lib/api_reference/models/price_filter.rb +116 -0
  511. data/lib/api_reference/models/price_group.rb +132 -0
  512. data/lib/api_reference/models/price_interval.rb +319 -0
  513. data/lib/api_reference/models/price_interval_fixed_fee_quantity_transition_params.rb +112 -0
  514. data/lib/api_reference/models/price_type.rb +48 -0
  515. data/lib/api_reference/models/price_type6.rb +40 -0
  516. data/lib/api_reference/models/prices.rb +109 -0
  517. data/lib/api_reference/models/product.rb +123 -0
  518. data/lib/api_reference/models/provider_type.rb +36 -0
  519. data/lib/api_reference/models/quantity_only_override_price.rb +147 -0
  520. data/lib/api_reference/models/reason.rb +44 -0
  521. data/lib/api_reference/models/reason1.rb +44 -0
  522. data/lib/api_reference/models/redeem_coupon_params.rb +126 -0
  523. data/lib/api_reference/models/remove_plan_adjustment_params.rb +74 -0
  524. data/lib/api_reference/models/remove_plan_price_params.rb +74 -0
  525. data/lib/api_reference/models/remove_subscription_adjustment_params.rb +74 -0
  526. data/lib/api_reference/models/remove_subscription_price_params.rb +90 -0
  527. data/lib/api_reference/models/replace_plan_adjustment_params.rb +108 -0
  528. data/lib/api_reference/models/replace_plan_price_params.rb +112 -0
  529. data/lib/api_reference/models/replace_subscription_adjustment_params.rb +108 -0
  530. data/lib/api_reference/models/replace_subscription_price_params.rb +203 -0
  531. data/lib/api_reference/models/reporting_configuration.rb +87 -0
  532. data/lib/api_reference/models/request_too_large_error.rb +101 -0
  533. data/lib/api_reference/models/request_validation_error.rb +112 -0
  534. data/lib/api_reference/models/resource_not_found_error.rb +99 -0
  535. data/lib/api_reference/models/resource_too_large_error.rb +101 -0
  536. data/lib/api_reference/models/scalable_matrix_with_tiered_pricing_config.rb +112 -0
  537. data/lib/api_reference/models/scalable_matrix_with_tiered_pricing_config1.rb +146 -0
  538. data/lib/api_reference/models/scalable_matrix_with_tiered_pricing_price.rb +589 -0
  539. data/lib/api_reference/models/scalable_matrix_with_tiered_scaling_factor.rb +109 -0
  540. data/lib/api_reference/models/scalable_matrix_with_tiered_tier_entry.rb +92 -0
  541. data/lib/api_reference/models/scalable_matrix_with_unit_pricing_config.rb +125 -0
  542. data/lib/api_reference/models/scalable_matrix_with_unit_pricing_config1.rb +155 -0
  543. data/lib/api_reference/models/scalable_matrix_with_unit_pricing_price.rb +589 -0
  544. data/lib/api_reference/models/scalable_matrix_with_unit_scaling_factor.rb +109 -0
  545. data/lib/api_reference/models/set_default_version.rb +60 -0
  546. data/lib/api_reference/models/start_of_term.rb +26 -0
  547. data/lib/api_reference/models/status.rb +40 -0
  548. data/lib/api_reference/models/status1.rb +48 -0
  549. data/lib/api_reference/models/status10.rb +40 -0
  550. data/lib/api_reference/models/status11.rb +48 -0
  551. data/lib/api_reference/models/status12.rb +40 -0
  552. data/lib/api_reference/models/status13.rb +40 -0
  553. data/lib/api_reference/models/status14.rb +40 -0
  554. data/lib/api_reference/models/status17.rb +37 -0
  555. data/lib/api_reference/models/status18.rb +49 -0
  556. data/lib/api_reference/models/status23.rb +48 -0
  557. data/lib/api_reference/models/status28.rb +40 -0
  558. data/lib/api_reference/models/status3.rb +36 -0
  559. data/lib/api_reference/models/status7.rb +36 -0
  560. data/lib/api_reference/models/sub_line_item_grouping.rb +106 -0
  561. data/lib/api_reference/models/sub_line_item_matrix_config.rb +89 -0
  562. data/lib/api_reference/models/subscription.rb +680 -0
  563. data/lib/api_reference/models/subscription_change_list_response.rb +152 -0
  564. data/lib/api_reference/models/subscription_change_list_responses.rb +92 -0
  565. data/lib/api_reference/models/subscription_change_minified.rb +86 -0
  566. data/lib/api_reference/models/subscription_change_response.rb +217 -0
  567. data/lib/api_reference/models/subscription_costs.rb +81 -0
  568. data/lib/api_reference/models/subscription_minified.rb +86 -0
  569. data/lib/api_reference/models/subscription_plan_change.rb +502 -0
  570. data/lib/api_reference/models/subscription_schedule_item.rb +122 -0
  571. data/lib/api_reference/models/subscription_schedule_items.rb +92 -0
  572. data/lib/api_reference/models/subscription_trial_info.rb +96 -0
  573. data/lib/api_reference/models/subscription_usage_request_params.rb +207 -0
  574. data/lib/api_reference/models/subscriptions.rb +92 -0
  575. data/lib/api_reference/models/tax_amount.rb +123 -0
  576. data/lib/api_reference/models/threshold.rb +90 -0
  577. data/lib/api_reference/models/threshold_discount_group.rb +147 -0
  578. data/lib/api_reference/models/threshold_override.rb +121 -0
  579. data/lib/api_reference/models/threshold_override_params.rb +97 -0
  580. data/lib/api_reference/models/threshold_total_amount_config.rb +83 -0
  581. data/lib/api_reference/models/threshold_total_amount_config1.rb +101 -0
  582. data/lib/api_reference/models/threshold_total_amount_price.rb +588 -0
  583. data/lib/api_reference/models/tier.rb +105 -0
  584. data/lib/api_reference/models/tier_sub_line_item.rb +160 -0
  585. data/lib/api_reference/models/tier_sub_line_item_tier_config.rb +119 -0
  586. data/lib/api_reference/models/tiered_config.rb +98 -0
  587. data/lib/api_reference/models/tiered_conversion_rate_config.rb +81 -0
  588. data/lib/api_reference/models/tiered_package_price.rb +587 -0
  589. data/lib/api_reference/models/tiered_package_pricing_config.rb +83 -0
  590. data/lib/api_reference/models/tiered_package_pricing_config1.rb +109 -0
  591. data/lib/api_reference/models/tiered_package_pricing_with_minimum_config.rb +79 -0
  592. data/lib/api_reference/models/tiered_package_pricing_with_minimum_config1.rb +105 -0
  593. data/lib/api_reference/models/tiered_package_tier_item.rb +92 -0
  594. data/lib/api_reference/models/tiered_package_with_minimum_price.rb +588 -0
  595. data/lib/api_reference/models/tiered_package_with_minimum_tier_item.rb +106 -0
  596. data/lib/api_reference/models/tiered_percentage_discount.rb +164 -0
  597. data/lib/api_reference/models/tiered_percentage_discount_interval.rb +201 -0
  598. data/lib/api_reference/models/tiered_price.rb +584 -0
  599. data/lib/api_reference/models/tiered_pricing_with_minimum_config.rb +93 -0
  600. data/lib/api_reference/models/tiered_pricing_with_minimum_config1.rb +111 -0
  601. data/lib/api_reference/models/tiered_pricing_with_minimum_tier_item.rb +106 -0
  602. data/lib/api_reference/models/tiered_total_threshold.rb +90 -0
  603. data/lib/api_reference/models/tiered_with_minimum_price.rb +587 -0
  604. data/lib/api_reference/models/tiered_with_proration_config.rb +70 -0
  605. data/lib/api_reference/models/tiered_with_proration_config1.rb +88 -0
  606. data/lib/api_reference/models/tiered_with_proration_price.rb +587 -0
  607. data/lib/api_reference/models/tiered_with_proration_tier.rb +92 -0
  608. data/lib/api_reference/models/too_many_results_error.rb +101 -0
  609. data/lib/api_reference/models/top_up.rb +149 -0
  610. data/lib/api_reference/models/top_up_invoice_settings.rb +117 -0
  611. data/lib/api_reference/models/top_up_invoice_settings2.rb +117 -0
  612. data/lib/api_reference/models/top_ups.rb +92 -0
  613. data/lib/api_reference/models/trial_config.rb +104 -0
  614. data/lib/api_reference/models/trial_discount.rb +161 -0
  615. data/lib/api_reference/models/trial_end_date.rb +26 -0
  616. data/lib/api_reference/models/trigger_subscription_phase_params.rb +84 -0
  617. data/lib/api_reference/models/type.rb +40 -0
  618. data/lib/api_reference/models/type1.rb +36 -0
  619. data/lib/api_reference/models/type2.rb +26 -0
  620. data/lib/api_reference/models/type3.rb +36 -0
  621. data/lib/api_reference/models/type4.rb +36 -0
  622. data/lib/api_reference/models/type5.rb +492 -0
  623. data/lib/api_reference/models/type6.rb +40 -0
  624. data/lib/api_reference/models/type7.rb +36 -0
  625. data/lib/api_reference/models/ungrouped_subscription_usage.rb +99 -0
  626. data/lib/api_reference/models/ungrouped_subscription_usage_record.rb +133 -0
  627. data/lib/api_reference/models/unit_config.rb +85 -0
  628. data/lib/api_reference/models/unit_conversion_rate_config.rb +80 -0
  629. data/lib/api_reference/models/unit_price.rb +584 -0
  630. data/lib/api_reference/models/unit_with_percent_config.rb +68 -0
  631. data/lib/api_reference/models/unit_with_percent_config1.rb +90 -0
  632. data/lib/api_reference/models/unit_with_percent_price.rb +587 -0
  633. data/lib/api_reference/models/unit_with_proration_config.rb +60 -0
  634. data/lib/api_reference/models/unit_with_proration_config1.rb +74 -0
  635. data/lib/api_reference/models/unit_with_proration_price.rb +587 -0
  636. data/lib/api_reference/models/unschedule_fixed_fee_quantity_change_params.rb +60 -0
  637. data/lib/api_reference/models/upcoming_invoice.rb +838 -0
  638. data/lib/api_reference/models/update_alert_query_params.rb +65 -0
  639. data/lib/api_reference/models/update_alert_request_params.rb +116 -0
  640. data/lib/api_reference/models/update_invoice_request_params.rb +145 -0
  641. data/lib/api_reference/models/update_metric_request_params.rb +66 -0
  642. data/lib/api_reference/models/update_price_request_params.rb +66 -0
  643. data/lib/api_reference/models/update_subscription_params.rb +137 -0
  644. data/lib/api_reference/models/update_trial_request_params.rb +94 -0
  645. data/lib/api_reference/models/url_not_found.rb +101 -0
  646. data/lib/api_reference/models/usage.rb +131 -0
  647. data/lib/api_reference/models/usage_discount.rb +129 -0
  648. data/lib/api_reference/models/usage_discount_creation_params.rb +82 -0
  649. data/lib/api_reference/models/usage_discount_interval.rb +188 -0
  650. data/lib/api_reference/models/validation_error.rb +86 -0
  651. data/lib/api_reference/models/view_mode.rb +36 -0
  652. data/lib/api_reference/models/void_initiated_ledger_entry.rb +356 -0
  653. data/lib/api_reference/models/void_ledger_entry.rb +334 -0
  654. data/lib/api_reference/models/void_reason.rb +26 -0
  655. data/lib/api_reference/utilities/date_time_helper.rb +11 -0
  656. data/lib/api_reference/utilities/file_wrapper.rb +28 -0
  657. data/lib/api_reference/utilities/union_type_lookup.rb +1433 -0
  658. data/lib/api_reference.rb +752 -0
  659. metadata +742 -0
@@ -0,0 +1,1575 @@
1
+ # api_reference
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module ApiReference
7
+ # SubscriptionApi
8
+ class SubscriptionApi < BaseApi
9
+ # This endpoint returns a list of all subscriptions for an account as a
10
+ # [paginated](/api-reference/pagination) list,
11
+ # ordered starting from the most recently created subscription. For a full
12
+ # discussion of the subscription resource,
13
+ # see [Subscription](/core-concepts##subscription).
14
+ # Subscriptions can be filtered for one or more customers by using the
15
+ # customer_id[] or external_customer_id[] query parameters.
16
+ # Subscriptions can be filtered by one or more statuses (each one of
17
+ # `active`, `ended`, or `upcoming`) using the status[] query parameter, e.g.
18
+ # `status[]=active&status[]=ended`.
19
+ # @param [Integer] limit Optional parameter: Example:20
20
+ # @param [String] cursor Optional parameter: TODO: type description here
21
+ # @param [Array[String]] customer_id Optional parameter: TODO: type
22
+ # description here
23
+ # @param [Array[String]] external_customer_id Optional parameter: TODO: type
24
+ # description here
25
+ # @param [String] plan_id Optional parameter: TODO: type description here
26
+ # @param [String] external_plan_id Optional parameter: TODO: type
27
+ # description here
28
+ # @param [Array[Status28]] status Optional parameter: TODO: type description
29
+ # here
30
+ # @param [DateTime] created_at_gte Optional parameter: TODO: type
31
+ # description here
32
+ # @param [DateTime] created_at_gt Optional parameter: TODO: type description
33
+ # here
34
+ # @param [DateTime] created_at_lt Optional parameter: TODO: type description
35
+ # here
36
+ # @param [DateTime] created_at_lte Optional parameter: TODO: type
37
+ # description here
38
+ # @return [ApiResponse] Complete http response with raw body and status code.
39
+ def list_subscriptions(limit: 20,
40
+ cursor: nil,
41
+ customer_id: nil,
42
+ external_customer_id: nil,
43
+ plan_id: nil,
44
+ external_plan_id: nil,
45
+ status: nil,
46
+ created_at_gte: nil,
47
+ created_at_gt: nil,
48
+ created_at_lt: nil,
49
+ created_at_lte: nil)
50
+ @api_call
51
+ .request(new_request_builder(HttpMethodEnum::GET,
52
+ '/subscriptions',
53
+ Server::DEFAULT)
54
+ .query_param(new_parameter(limit, key: 'limit'))
55
+ .query_param(new_parameter(cursor, key: 'cursor'))
56
+ .query_param(new_parameter(customer_id, key: 'customer_id[]'))
57
+ .query_param(new_parameter(external_customer_id, key: 'external_customer_id[]'))
58
+ .query_param(new_parameter(plan_id, key: 'plan_id'))
59
+ .query_param(new_parameter(external_plan_id, key: 'external_plan_id'))
60
+ .query_param(new_parameter(status, key: 'status[]'))
61
+ .query_param(new_parameter(created_at_gte, key: 'created_at[gte]'))
62
+ .query_param(new_parameter(created_at_gt, key: 'created_at[gt]'))
63
+ .query_param(new_parameter(created_at_lt, key: 'created_at[lt]'))
64
+ .query_param(new_parameter(created_at_lte, key: 'created_at[lte]'))
65
+ .header_param(new_parameter('application/json', key: 'accept'))
66
+ .auth(Single.new('APIKeyAuth')))
67
+ .response(new_response_handler
68
+ .deserializer(APIHelper.method(:custom_type_deserializer))
69
+ .deserialize_into(Subscriptions.method(:from_hash))
70
+ .is_api_response(true)
71
+ .local_error('400',
72
+ 'Bad Request',
73
+ APIException)
74
+ .local_error('401',
75
+ 'Unauthorized',
76
+ AuthorizationErrorException)
77
+ .local_error('404',
78
+ 'Not Found',
79
+ APIException)
80
+ .local_error('409',
81
+ 'Conflict',
82
+ IdempotencyRequestMismatchException)
83
+ .local_error('413',
84
+ 'Content Too Large',
85
+ APIException)
86
+ .local_error('429',
87
+ 'Too Many Requests',
88
+ TooManyRequestsException)
89
+ .local_error('500',
90
+ 'Internal Server Error',
91
+ ServerErrorException))
92
+ .execute
93
+ end
94
+
95
+ # A subscription represents the purchase of a plan by a customer. The
96
+ # customer is identified by either the `customer_id`
97
+ # or the `external_customer_id`, and exactly one of these fields must be
98
+ # provided.
99
+ # By default, subscriptions begin on the day that they're created and renew
100
+ # automatically for each billing cycle at the
101
+ # cadence that's configured in the plan definition.
102
+ # The default configuration for subscriptions in Orb is **In-advance
103
+ # billing** and **Beginning of month alignment** (see
104
+ # [Subscription](/core-concepts##subscription) for more details).
105
+ # In order to change the alignment behavior, Orb also supports billing
106
+ # subscriptions on the day of the month they are
107
+ # created. If `align_billing_with_subscription_start_date = true` is
108
+ # specified, subscriptions have billing cycles that are
109
+ # aligned with their `start_date`. For example, a subscription that begins
110
+ # on January 15th will have a billing cycle from
111
+ # January 15th to February 15th. Every subsequent billing cycle will
112
+ # continue to start and invoice on the 15th.
113
+ # If the "day" value is greater than the number of days in the month, the
114
+ # next billing cycle will start at the end of the
115
+ # month. For example, if the start_date is January 31st, the next billing
116
+ # cycle will start on February 28th.
117
+ # If a customer was created with a currency, Orb only allows subscribing the
118
+ # customer to a plan with a matching
119
+ # `invoicing_currency`. If the customer does not have a currency set, on
120
+ # subscription creation, we set the customer's
121
+ # currency to be the `invoicing_currency` of the plan.
122
+ # ## Customize your customer's subscriptions
123
+ # Prices and adjustments in a plan can be added, removed, or replaced for
124
+ # the subscription being created. This is useful when a
125
+ # customer has prices that differ from the default prices for a specific
126
+ # plan.
127
+ # <Note>
128
+ # This feature is only available for accounts that have migrated to
129
+ # Subscription Overrides Version 2. You can find your
130
+ # Subscription Overrides Version at the bottom of your [Plans
131
+ # page](https://app.withorb.com/plans)
132
+ # </Note>
133
+ # ### Adding Prices
134
+ # To add prices, provide a list of objects with the key `add_prices`. An
135
+ # object in the list must specify an existing add-on price
136
+ # with a `price_id` or `external_price_id` field, or create a new add-on
137
+ # price by including an object with the key `price`,
138
+ # identical to what would be used in the request body for the [create price
139
+ # endpoint](/api-reference/price/create-price). See the
140
+ # [Price resource](/product-catalog/price-configuration) for the
141
+ # specification
142
+ # of different price model configurations possible in this object.
143
+ # If the plan has phases, each object in the list must include a number with
144
+ # `plan_phase_order` key to indicate which phase the
145
+ # price should be added to.
146
+ # An object in the list can specify an optional `start_date` and optional
147
+ # `end_date`. This is equivalent to creating a price
148
+ # interval with the [add/edit price intervals
149
+ # endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
150
+ # If unspecified, the start or end date of the phase or subscription will be
151
+ # used.
152
+ # An object in the list can specify an optional `minimum_amount`,
153
+ # `maximum_amount`, or `discounts`. This will create adjustments
154
+ # which apply only to this price.
155
+ # Additionally, an object in the list can specify an optional
156
+ # `reference_id`. This ID can be used to reference this price when
157
+ # [adding an adjustment](#adding-adjustments) in the same API call. However
158
+ # the ID is _transient_ and cannot be used to refer to
159
+ # the price in future API calls.
160
+ # ### Removing Prices
161
+ # To remove prices, provide a list of objects with the key `remove_prices`.
162
+ # An object in the list must specify a plan price with
163
+ # either a `price_id` or `external_price_id` field.
164
+ # ### Replacing Prices
165
+ # To replace prices, provide a list of objects with the key
166
+ # `replace_prices`. An object in the list must specify a plan price to
167
+ # replace with the `replaces_price_id` key, and it must specify a price to
168
+ # replace it with by either referencing an existing
169
+ # add-on price with a `price_id` or `external_price_id` field, or by
170
+ # creating a new add-on price by including an object with the
171
+ # key `price`, identical to what would be used in the request body for
172
+ # the [create price endpoint](/api-reference/price/create-price).
173
+ # See the [Price resource](/product-catalog/price-configuration)
174
+ # for the specification of different price model configurations possible in
175
+ # this
176
+ # object.
177
+ # For fixed fees, an object in the list can supply a `fixed_price_quantity`
178
+ # instead of a `price`, `price_id`, or
179
+ # `external_price_id` field. This will update only the quantity for the
180
+ # price, similar to the
181
+ # [Update price quantity](/api-reference/subscription/update-price-quantity)
182
+ # endpoint.
183
+ # The replacement price will have the same phase, if applicable, and the
184
+ # same start and end dates as the price it replaces.
185
+ # An object in the list can specify an optional `minimum_amount`,
186
+ # `maximum_amount`, or `discounts`. This will create adjustments
187
+ # which apply only to this price.
188
+ # Additionally, an object in the list can specify an optional
189
+ # `reference_id`. This ID can be used to reference the replacement
190
+ # price when [adding an adjustment](#adding-adjustments) in the same API
191
+ # call. However the ID is _transient_ and cannot be used to
192
+ # refer to the price in future API calls.
193
+ # ### Adding adjustments
194
+ # To add adjustments, provide a list of objects with the key
195
+ # `add_adjustments`. An object in the list must include an object with
196
+ # the key `adjustment`, identical to the adjustment object in the
197
+ # [add/edit price intervals
198
+ # endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
199
+ # If the plan has phases, each object in the list must include a number with
200
+ # `plan_phase_order` key to indicate which phase the
201
+ # adjustment should be added to.
202
+ # An object in the list can specify an optional `start_date` and optional
203
+ # `end_date`. If unspecified, the start or end date of the
204
+ # phase or subscription will be used.
205
+ # ### Removing adjustments
206
+ # To remove adjustments, provide a list of objects with the key
207
+ # `remove_adjustments`. An object in the list must include a key,
208
+ # `adjustment_id`, with the ID of the adjustment to be removed.
209
+ # ### Replacing adjustments
210
+ # To replace adjustments, provide a list of objects with the key
211
+ # `replace_adjustments`. An object in the list must specify a plan
212
+ # adjustment to replace with the `replaces_adjustment_id` key, and it must
213
+ # specify an adjustment to replace it with by including
214
+ # an object with the key `adjustment`, identical to the adjustment object in
215
+ # the
216
+ # [add/edit price intervals
217
+ # endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
218
+ # The replacement adjustment will have the same phase, if applicable, and
219
+ # the same start and end dates as the adjustment it
220
+ # replaces.
221
+ # ## Price overrides (DEPRECATED)
222
+ # <Note>
223
+ # Price overrides are being phased out in favor adding/removing/replacing
224
+ # prices. (See
225
+ # [Customize your customer's
226
+ # subscriptions](/api-reference/subscription/create-subscription))
227
+ # </Note>
228
+ # Price overrides are used to update some or all prices in a plan for the
229
+ # specific subscription being created. This is
230
+ # useful when a new customer has negotiated a rate that is unique to the
231
+ # customer.
232
+ # To override prices, provide a list of objects with the key
233
+ # `price_overrides`. The price object in the list of overrides
234
+ # is expected to contain the existing price id, the `model_type` and
235
+ # configuration.
236
+ # (See the [Price resource](/product-catalog/price-configuration)
237
+ # for the specification of different price model configurations.) The
238
+ # numerical values can be updated, but the billable metric,
239
+ # cadence, type, and name of a price can not be overridden.
240
+ # ### Maximums and Minimums
241
+ # Minimums and maximums, much like price overrides, can be useful when a new
242
+ # customer has negotiated a new or different
243
+ # minimum or maximum spend cap than the default for a given price. If one
244
+ # exists for a price
245
+ # and null is provided for the minimum/maximum override on creation, then
246
+ # there
247
+ # will be no minimum/maximum on the new subscription. If no value is
248
+ # provided, then the default price maximum or minimum is
249
+ # used.
250
+ # To add a minimum for a specific price, add `minimum_amount` to the
251
+ # specific price in the `price_overrides` object.
252
+ # To add a maximum for a specific price, add `maximum_amount` to the
253
+ # specific price in the `price_overrides` object.
254
+ # ### Minimum override example
255
+ # Price minimum override example:
256
+ # ```json
257
+ # {
258
+ # ...
259
+ # "id": "price_id",
260
+ # "model_type": "unit",
261
+ # "unit_config": {
262
+ # "unit_amount": "0.50"
263
+ # },
264
+ # "minimum_amount": "100.00"
265
+ # ...
266
+ # }
267
+ # ```
268
+ # Removing an existing minimum example
269
+ # ```json
270
+ # {
271
+ # ...
272
+ # "id": "price_id",
273
+ # "model_type": "unit",
274
+ # "unit_config": {
275
+ # "unit_amount": "0.50"
276
+ # },
277
+ # "minimum_amount": null
278
+ # ...
279
+ # }
280
+ # ```
281
+ # ### Discounts
282
+ # Discounts, like price overrides, can be useful when a new customer has
283
+ # negotiated a new or different discount than the default
284
+ # for a price. If a discount exists for a price and a null discount is
285
+ # provided on creation, then there will be no discount on the
286
+ # new subscription.
287
+ # To add a discount for a specific price, add `discount` to the price in the
288
+ # `price_overrides` object. Discount should be a
289
+ # dictionary of the format:
290
+ # ```ts
291
+ # {
292
+ # "discount_type": "amount" | "percentage" | "usage",
293
+ # "amount_discount": string,
294
+ # "percentage_discount": string,
295
+ # "usage_discount": string
296
+ # }
297
+ # ```
298
+ # where either `amount_discount`, `percentage_discount`, or `usage_discount`
299
+ # is provided.
300
+ # Price discount example
301
+ # ```json
302
+ # {
303
+ # ...
304
+ # "id": "price_id",
305
+ # "model_type": "unit",
306
+ # "unit_config": {
307
+ # "unit_amount": "0.50"
308
+ # },
309
+ # "discount": {"discount_type": "amount", "amount_discount": "175"},
310
+ # }
311
+ # ```
312
+ # Removing an existing discount example
313
+ # ```json
314
+ # {
315
+ # "customer_id": "customer_id",
316
+ # "plan_id": "plan_id",
317
+ # "discount": null,
318
+ # "price_overrides": [ ... ]
319
+ # ...
320
+ # }
321
+ # ```
322
+ # ## Threshold Billing
323
+ # Orb supports invoicing for a subscription when a preconfigured usage
324
+ # threshold is hit. To enable threshold billing, pass
325
+ # in an `invoicing_threshold`, which is specified in the subscription's
326
+ # invoicing currency, when creating a subscription.
327
+ # E.g. pass in `10.00` to issue an invoice when usage amounts hit \$10.00
328
+ # for a subscription that invoices in USD.
329
+ # ## Limits
330
+ # By default, Orb limits the number of subscriptions per customer to 100.
331
+ # @param [NewSubscription] body Required parameter: TODO: type description
332
+ # here
333
+ # @return [ApiResponse] Complete http response with raw body and status code.
334
+ def create_subscription(body)
335
+ @api_call
336
+ .request(new_request_builder(HttpMethodEnum::POST,
337
+ '/subscriptions',
338
+ Server::DEFAULT)
339
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
340
+ .body_param(new_parameter(body)
341
+ .is_required(true))
342
+ .header_param(new_parameter('application/json', key: 'accept'))
343
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
344
+ .auth(Single.new('APIKeyAuth')))
345
+ .response(new_response_handler
346
+ .deserializer(APIHelper.method(:custom_type_deserializer))
347
+ .deserialize_into(MutatedSubscription.method(:from_hash))
348
+ .is_api_response(true)
349
+ .local_error('400',
350
+ 'Bad Request',
351
+ APIException)
352
+ .local_error('401',
353
+ 'Unauthorized',
354
+ AuthorizationErrorException)
355
+ .local_error('404',
356
+ 'Not Found',
357
+ APIException)
358
+ .local_error('409',
359
+ 'Conflict',
360
+ IdempotencyRequestMismatchException)
361
+ .local_error('413',
362
+ 'Content Too Large',
363
+ APIException)
364
+ .local_error('429',
365
+ 'Too Many Requests',
366
+ TooManyRequestsException)
367
+ .local_error('500',
368
+ 'Internal Server Error',
369
+ ServerErrorException))
370
+ .execute
371
+ end
372
+
373
+ # This endpoint is used to fetch a
374
+ # [Subscription](/core-concepts##subscription) given an identifier.
375
+ # @param [String] subscription_id Required parameter: TODO: type description
376
+ # here
377
+ # @return [ApiResponse] Complete http response with raw body and status code.
378
+ def fetch_subscription(subscription_id)
379
+ @api_call
380
+ .request(new_request_builder(HttpMethodEnum::GET,
381
+ '/subscriptions/{subscription_id}',
382
+ Server::DEFAULT)
383
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
384
+ .is_required(true)
385
+ .should_encode(true))
386
+ .header_param(new_parameter('application/json', key: 'accept'))
387
+ .auth(Single.new('APIKeyAuth')))
388
+ .response(new_response_handler
389
+ .deserializer(APIHelper.method(:custom_type_deserializer))
390
+ .deserialize_into(Subscription.method(:from_hash))
391
+ .is_api_response(true)
392
+ .local_error('400',
393
+ 'Bad Request',
394
+ APIException)
395
+ .local_error('401',
396
+ 'Unauthorized',
397
+ AuthorizationErrorException)
398
+ .local_error('404',
399
+ 'Not Found',
400
+ APIException)
401
+ .local_error('409',
402
+ 'Conflict',
403
+ IdempotencyRequestMismatchException)
404
+ .local_error('413',
405
+ 'Content Too Large',
406
+ APIException)
407
+ .local_error('429',
408
+ 'Too Many Requests',
409
+ TooManyRequestsException)
410
+ .local_error('500',
411
+ 'Internal Server Error',
412
+ ServerErrorException))
413
+ .execute
414
+ end
415
+
416
+ # This endpoint can be used to update the `metadata`, `net terms`,
417
+ # `auto_collection`, `invoicing_threshold`,
418
+ # and `default_invoice_memo` properties on a subscription.
419
+ # @param [String] subscription_id Required parameter: TODO: type description
420
+ # here
421
+ # @param [UpdateSubscriptionParams] body Required parameter: TODO: type
422
+ # description here
423
+ # @return [ApiResponse] Complete http response with raw body and status code.
424
+ def update_subscription(subscription_id,
425
+ body)
426
+ @api_call
427
+ .request(new_request_builder(HttpMethodEnum::PUT,
428
+ '/subscriptions/{subscription_id}',
429
+ Server::DEFAULT)
430
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
431
+ .is_required(true)
432
+ .should_encode(true))
433
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
434
+ .body_param(new_parameter(body)
435
+ .is_required(true))
436
+ .header_param(new_parameter('application/json', key: 'accept'))
437
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
438
+ .auth(Single.new('APIKeyAuth')))
439
+ .response(new_response_handler
440
+ .deserializer(APIHelper.method(:custom_type_deserializer))
441
+ .deserialize_into(Subscription.method(:from_hash))
442
+ .is_api_response(true)
443
+ .local_error('400',
444
+ 'Bad Request',
445
+ APIException)
446
+ .local_error('401',
447
+ 'Unauthorized',
448
+ AuthorizationErrorException)
449
+ .local_error('404',
450
+ 'Not Found',
451
+ APIException)
452
+ .local_error('409',
453
+ 'Conflict',
454
+ IdempotencyRequestMismatchException)
455
+ .local_error('413',
456
+ 'Content Too Large',
457
+ APIException)
458
+ .local_error('429',
459
+ 'Too Many Requests',
460
+ TooManyRequestsException)
461
+ .local_error('500',
462
+ 'Internal Server Error',
463
+ ServerErrorException))
464
+ .execute
465
+ end
466
+
467
+ # This endpoint can be used to cancel an existing subscription. It returns
468
+ # the serialized subscription object with an
469
+ # `end_date` parameter that signifies when the subscription will transition
470
+ # to an ended state.
471
+ # The body parameter `cancel_option` determines the cancellation behavior.
472
+ # Orb supports three cancellation options:
473
+ # - `end_of_subscription_term`: stops the subscription from auto-renewing.
474
+ # Subscriptions that have been cancelled with
475
+ # this option can still incur charges for the remainder of their term:
476
+ # - Issuing this cancellation request for a monthly subscription will
477
+ # keep the subscription active until the start
478
+ # of the subsequent month, and potentially issue an invoice for any
479
+ # usage charges incurred in the intervening
480
+ # period.
481
+ # - Issuing this cancellation request for a quarterly subscription will
482
+ # keep the subscription active until the end
483
+ # of the quarter and potentially issue an invoice for any usage
484
+ # charges incurred in the intervening period.
485
+ # - Issuing this cancellation request for a yearly subscription will
486
+ # keep the subscription active for the full
487
+ # year. For example, a yearly subscription starting on 2021-11-01 and
488
+ # cancelled on 2021-12-08 will remain active
489
+ # until 2022-11-01 and potentially issue charges in the intervening
490
+ # months for any recurring monthly usage
491
+ # charges in its plan.
492
+ # - **Note**: If a subscription's plan contains prices with difference
493
+ # cadences, the end of term date will be
494
+ # determined by the largest cadence value. For example, cancelling end
495
+ # of term for a subscription with a
496
+ # quarterly fixed fee with a monthly usage fee will result in the
497
+ # subscription ending at the end of the quarter.
498
+ # - `immediate`: ends the subscription immediately, setting the `end_date`
499
+ # to the current time:
500
+ # - Subscriptions that have been cancelled with this option will be
501
+ # invoiced immediately. This invoice will
502
+ # include any usage fees incurred in the billing period up to the
503
+ # cancellation, along with any prorated
504
+ # recurring fees for the billing period, if applicable.
505
+ # - **Note**: If the subscription has a recurring fee that was paid
506
+ # in-advance, the prorated amount for the
507
+ # remaining time period will be added to the [customer's
508
+ # balance](list-balance-transactions) upon immediate
509
+ # cancellation. However, if the customer is ineligible to use the
510
+ # customer balance, the subscription cannot be
511
+ # cancelled immediately.
512
+ # - `requested_date`: ends the subscription on a specified date, which
513
+ # requires a `cancellation_date` to be passed in.
514
+ # If no timezone is provided, the customer's timezone is used. For
515
+ # example, a subscription starting on January 1st
516
+ # with a monthly price can be set to be cancelled on the first of any
517
+ # month after January 1st (e.g. March 1st, April
518
+ # 1st, May 1st). A subscription with multiple prices with different
519
+ # cadences defines the "term" to be the highest
520
+ # cadence of the prices.
521
+ # Upcoming subscriptions are only eligible for immediate cancellation, which
522
+ # will set the `end_date` equal to the
523
+ # `start_date` upon cancellation.
524
+ # ## Backdated cancellations
525
+ # Orb allows you to cancel a subscription in the past as long as there are
526
+ # no paid invoices between the
527
+ # `requested_date` and the current time. If the cancellation is after the
528
+ # latest issued invoice, Orb will generate a
529
+ # balance refund for the current period. If the cancellation is before the
530
+ # most recently issued invoice, Orb will void
531
+ # the intervening invoice and generate a new one based on the new dates for
532
+ # the subscription. See the section on
533
+ # [cancellation
534
+ # behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors)
535
+ # .
536
+ # @param [String] subscription_id Required parameter: TODO: type description
537
+ # here
538
+ # @param [CancelSubscriptionParams] body Required parameter: TODO: type
539
+ # description here
540
+ # @return [ApiResponse] Complete http response with raw body and status code.
541
+ def cancel_subscription(subscription_id,
542
+ body)
543
+ @api_call
544
+ .request(new_request_builder(HttpMethodEnum::POST,
545
+ '/subscriptions/{subscription_id}/cancel',
546
+ Server::DEFAULT)
547
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
548
+ .is_required(true)
549
+ .should_encode(true))
550
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
551
+ .body_param(new_parameter(body)
552
+ .is_required(true))
553
+ .header_param(new_parameter('application/json', key: 'accept'))
554
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
555
+ .auth(Single.new('APIKeyAuth')))
556
+ .response(new_response_handler
557
+ .deserializer(APIHelper.method(:custom_type_deserializer))
558
+ .deserialize_into(MutatedSubscription.method(:from_hash))
559
+ .is_api_response(true)
560
+ .local_error('400',
561
+ 'Bad Request',
562
+ APIException)
563
+ .local_error('401',
564
+ 'Unauthorized',
565
+ AuthorizationErrorException)
566
+ .local_error('404',
567
+ 'Not Found',
568
+ APIException)
569
+ .local_error('409',
570
+ 'Conflict',
571
+ IdempotencyRequestMismatchException)
572
+ .local_error('413',
573
+ 'Content Too Large',
574
+ APIException)
575
+ .local_error('429',
576
+ 'Too Many Requests',
577
+ TooManyRequestsException)
578
+ .local_error('500',
579
+ 'Internal Server Error',
580
+ ServerErrorException))
581
+ .execute
582
+ end
583
+
584
+ # This endpoint is used to fetch a day-by-day snapshot of a subscription's
585
+ # costs in Orb, calculated by applying
586
+ # pricing information to the underlying usage (see the [subscription usage
587
+ # endpoint](fetch-subscription-usage) to
588
+ # fetch usage per metric, in usage units rather than a currency).
589
+ # The semantics of this endpoint exactly mirror those of
590
+ # [fetching a customer's
591
+ # costs](/api-reference/customer/fetch-customer-costs).
592
+ # Use this endpoint to limit your analysis of costs to a specific
593
+ # subscription for the customer (e.g. to de-aggregate costs
594
+ # when a customer's subscription has started and stopped on the same day).
595
+ # @param [String] subscription_id Required parameter: TODO: type description
596
+ # here
597
+ # @param [DateTime] timeframe_start Optional parameter: TODO: type
598
+ # description here
599
+ # @param [DateTime] timeframe_end Optional parameter: TODO: type description
600
+ # here
601
+ # @param [ViewMode] view_mode Optional parameter: Example:
602
+ # @param [String] currency Optional parameter: TODO: type description here
603
+ # @return [ApiResponse] Complete http response with raw body and status code.
604
+ def fetch_subscription_costs(subscription_id,
605
+ timeframe_start: nil,
606
+ timeframe_end: nil,
607
+ view_mode: nil,
608
+ currency: nil)
609
+ @api_call
610
+ .request(new_request_builder(HttpMethodEnum::GET,
611
+ '/subscriptions/{subscription_id}/costs',
612
+ Server::DEFAULT)
613
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
614
+ .is_required(true)
615
+ .should_encode(true))
616
+ .query_param(new_parameter(timeframe_start, key: 'timeframe_start'))
617
+ .query_param(new_parameter(timeframe_end, key: 'timeframe_end'))
618
+ .query_param(new_parameter(view_mode, key: 'view_mode'))
619
+ .query_param(new_parameter(currency, key: 'currency'))
620
+ .header_param(new_parameter('application/json', key: 'accept'))
621
+ .auth(Single.new('APIKeyAuth')))
622
+ .response(new_response_handler
623
+ .deserializer(APIHelper.method(:custom_type_deserializer))
624
+ .deserialize_into(SubscriptionCosts.method(:from_hash))
625
+ .is_api_response(true)
626
+ .local_error('400',
627
+ 'Bad Request',
628
+ APIException)
629
+ .local_error('401',
630
+ 'Unauthorized',
631
+ AuthorizationErrorException)
632
+ .local_error('404',
633
+ 'Not Found',
634
+ APIException)
635
+ .local_error('409',
636
+ 'Conflict',
637
+ IdempotencyRequestMismatchException)
638
+ .local_error('413',
639
+ 'Content Too Large',
640
+ APIException)
641
+ .local_error('429',
642
+ 'Too Many Requests',
643
+ TooManyRequestsException)
644
+ .local_error('500',
645
+ 'Internal Server Error',
646
+ ServerErrorException))
647
+ .execute
648
+ end
649
+
650
+ # Redeem a coupon effective at a given time.
651
+ # @param [String] subscription_id Required parameter: TODO: type description
652
+ # here
653
+ # @param [RedeemCouponParams] body Required parameter: TODO: type
654
+ # description here
655
+ # @return [ApiResponse] Complete http response with raw body and status code.
656
+ def redeem_coupon(subscription_id,
657
+ body)
658
+ @api_call
659
+ .request(new_request_builder(HttpMethodEnum::POST,
660
+ '/subscriptions/{subscription_id}/redeem_coupon',
661
+ Server::DEFAULT)
662
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
663
+ .is_required(true)
664
+ .should_encode(true))
665
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
666
+ .body_param(new_parameter(body)
667
+ .is_required(true))
668
+ .header_param(new_parameter('application/json', key: 'accept'))
669
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
670
+ .auth(Single.new('APIKeyAuth')))
671
+ .response(new_response_handler
672
+ .deserializer(APIHelper.method(:custom_type_deserializer))
673
+ .deserialize_into(MutatedSubscription.method(:from_hash))
674
+ .is_api_response(true)
675
+ .local_error('400',
676
+ 'Bad Request',
677
+ APIException)
678
+ .local_error('401',
679
+ 'Unauthorized',
680
+ AuthorizationErrorException)
681
+ .local_error('404',
682
+ 'Not Found',
683
+ APIException)
684
+ .local_error('409',
685
+ 'Conflict',
686
+ IdempotencyRequestMismatchException)
687
+ .local_error('413',
688
+ 'Content Too Large',
689
+ APIException)
690
+ .local_error('429',
691
+ 'Too Many Requests',
692
+ TooManyRequestsException)
693
+ .local_error('500',
694
+ 'Internal Server Error',
695
+ ServerErrorException))
696
+ .execute
697
+ end
698
+
699
+ # This endpoint returns a [paginated](/api-reference/pagination) list of all
700
+ # plans associated with a subscription along
701
+ # with their start and end dates. This list contains the subscription's
702
+ # initial plan along with past and future plan
703
+ # changes.
704
+ # @param [String] subscription_id Required parameter: TODO: type description
705
+ # here
706
+ # @param [Integer] limit Optional parameter: Example:20
707
+ # @param [String] cursor Optional parameter: TODO: type description here
708
+ # @param [DateTime] start_date_gte Optional parameter: TODO: type
709
+ # description here
710
+ # @param [DateTime] start_date_gt Optional parameter: TODO: type description
711
+ # here
712
+ # @param [DateTime] start_date_lt Optional parameter: TODO: type description
713
+ # here
714
+ # @param [DateTime] start_date_lte Optional parameter: TODO: type
715
+ # description here
716
+ # @return [ApiResponse] Complete http response with raw body and status code.
717
+ def fetch_subscription_schedule(subscription_id,
718
+ limit: 20,
719
+ cursor: nil,
720
+ start_date_gte: nil,
721
+ start_date_gt: nil,
722
+ start_date_lt: nil,
723
+ start_date_lte: nil)
724
+ @api_call
725
+ .request(new_request_builder(HttpMethodEnum::GET,
726
+ '/subscriptions/{subscription_id}/schedule',
727
+ Server::DEFAULT)
728
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
729
+ .is_required(true)
730
+ .should_encode(true))
731
+ .query_param(new_parameter(limit, key: 'limit'))
732
+ .query_param(new_parameter(cursor, key: 'cursor'))
733
+ .query_param(new_parameter(start_date_gte, key: 'start_date[gte]'))
734
+ .query_param(new_parameter(start_date_gt, key: 'start_date[gt]'))
735
+ .query_param(new_parameter(start_date_lt, key: 'start_date[lt]'))
736
+ .query_param(new_parameter(start_date_lte, key: 'start_date[lte]'))
737
+ .header_param(new_parameter('application/json', key: 'accept'))
738
+ .auth(Single.new('APIKeyAuth')))
739
+ .response(new_response_handler
740
+ .deserializer(APIHelper.method(:custom_type_deserializer))
741
+ .deserialize_into(SubscriptionScheduleItems.method(:from_hash))
742
+ .is_api_response(true)
743
+ .local_error('400',
744
+ 'Bad Request',
745
+ APIException)
746
+ .local_error('401',
747
+ 'Unauthorized',
748
+ AuthorizationErrorException)
749
+ .local_error('404',
750
+ 'Not Found',
751
+ APIException)
752
+ .local_error('409',
753
+ 'Conflict',
754
+ IdempotencyRequestMismatchException)
755
+ .local_error('413',
756
+ 'Content Too Large',
757
+ APIException)
758
+ .local_error('429',
759
+ 'Too Many Requests',
760
+ TooManyRequestsException)
761
+ .local_error('500',
762
+ 'Internal Server Error',
763
+ ServerErrorException))
764
+ .execute
765
+ end
766
+
767
+ # This endpoint can be used to change an existing subscription's plan. It
768
+ # returns the serialized updated subscription object.
769
+ # The body parameter `change_option` determines when the plan change occurs.
770
+ # Orb supports three options:
771
+ # - `end_of_subscription_term`: changes the plan at the end of the existing
772
+ # plan's term.
773
+ # - Issuing this plan change request for a monthly subscription will
774
+ # keep the existing plan active until the start
775
+ # of the subsequent month. Issuing this plan change request for a
776
+ # yearly subscription will keep the existing plan active for
777
+ # the full year. Charges incurred in the remaining period will be
778
+ # invoiced as normal.
779
+ # - Example: The plan is billed monthly on the 1st of the month, the
780
+ # request is made on January 15th, so the plan will be
781
+ # changed on February 1st, and invoice will be issued on February 1st
782
+ # for the last month of the original plan.
783
+ # - `immediate`: changes the plan immediately.
784
+ # - Subscriptions that have their plan changed with this option will
785
+ # move to the new plan immediately, and be invoiced
786
+ # immediately.
787
+ # - This invoice will include any usage fees incurred in the billing
788
+ # period up to the change, along with any prorated
789
+ # recurring fees for the billing period, if applicable.
790
+ # - Example: The plan is billed monthly on the 1st of the month, the
791
+ # request is made on January 15th, so the plan will be
792
+ # changed on January 15th, and an invoice will be issued for the
793
+ # partial month, from January 1 to January 15, on the
794
+ # original plan.
795
+ # - `requested_date`: changes the plan on the requested date
796
+ # (`change_date`).
797
+ # - If no timezone is provided, the customer's timezone is used. The
798
+ # `change_date` body parameter is required if this option
799
+ # is chosen.
800
+ # - Example: The plan is billed monthly on the 1st of the month, the
801
+ # request is made on January 15th, with a requested
802
+ # `change_date` of February 15th, so the plan will be changed on
803
+ # February 15th, and invoices will be issued on February 1st
804
+ # and February 15th.
805
+ # Note that one of `plan_id` or `external_plan_id` is required in the
806
+ # request body for this operation.
807
+ # ## Customize your customer's subscriptions
808
+ # Prices and adjustments in a plan can be added, removed, or replaced on the
809
+ # subscription when you schedule the plan change. This
810
+ # is useful when a customer has prices that differ from the default prices
811
+ # for a specific plan.
812
+ # <Note>
813
+ # This feature is only available for accounts that have migrated to
814
+ # Subscription Overrides Version 2. You can find your
815
+ # Subscription Overrides Version at the bottom of your [Plans
816
+ # page](https://app.withorb.com/plans)
817
+ # </Note>
818
+ # ### Adding Prices
819
+ # To add prices, provide a list of objects with the key `add_prices`. An
820
+ # object in the list must specify an existing add-on price
821
+ # with a `price_id` or `external_price_id` field, or create a new add-on
822
+ # price by including an object with the key `price`,
823
+ # identical to what would be used in the request body for the [create price
824
+ # endpoint](/api-reference/price/create-price). See the
825
+ # [Price resource](/product-catalog/price-configuration) for the
826
+ # specification of different price model configurations possible
827
+ # in this object.
828
+ # If the plan has phases, each object in the list must include a number with
829
+ # `plan_phase_order` key to indicate which phase the
830
+ # price should be added to.
831
+ # An object in the list can specify an optional `start_date` and optional
832
+ # `end_date`. If `start_date` is unspecified, the start
833
+ # of the phase / plan change time will be used. If `end_date` is
834
+ # unspecified, it will finish at the end of the phase / have
835
+ # no end time.
836
+ # An object in the list can specify an optional `minimum_amount`,
837
+ # `maximum_amount`, or `discounts`. This will create adjustments
838
+ # which apply only to this price.
839
+ # Additionally, an object in the list can specify an optional
840
+ # `reference_id`. This ID can be used to reference this price when
841
+ # [adding an adjustment](#adding-adjustments) in the same API call. However
842
+ # the ID is _transient_ and cannot be used to refer to
843
+ # the price in future API calls.
844
+ # ### Removing Prices
845
+ # To remove prices, provide a list of objects with the key `remove_prices`.
846
+ # An object in the list must specify a plan price with
847
+ # either a `price_id` or `external_price_id` field.
848
+ # ### Replacing Prices
849
+ # To replace prices, provide a list of objects with the key
850
+ # `replace_prices`. An object in the list must specify a plan price to
851
+ # replace with the `replaces_price_id` key, and it must specify a price to
852
+ # replace it with by either referencing an existing
853
+ # add-on price with a `price_id` or `external_price_id` field, or by
854
+ # creating a new add-on price by including an object with the
855
+ # key `price`, identical to what would be used in the request body for
856
+ # the [create price endpoint](/api-reference/price/create-price).
857
+ # See the [Price resource](/product-catalog/price-configuration) for the
858
+ # specification of different price model configurations
859
+ # possible in this object.
860
+ # For fixed fees, an object in the list can supply a `fixed_price_quantity`
861
+ # instead of a `price`, `price_id`, or
862
+ # `external_price_id` field. This will update only the quantity for the
863
+ # price, similar to the
864
+ # [Update price quantity](/api-reference/subscription/update-price-quantity)
865
+ # endpoint.
866
+ # The replacement price will have the same phase, if applicable, and the
867
+ # same start and end dates as the price it replaces.
868
+ # An object in the list can specify an optional `minimum_amount`,
869
+ # `maximum_amount`, or `discounts`. This will create adjustments
870
+ # which apply only to this price.
871
+ # Additionally, an object in the list can specify an optional
872
+ # `reference_id`. This ID can be used to reference the replacement
873
+ # price when [adding an adjustment](#adding-adjustments) in the same API
874
+ # call. However the ID is _transient_ and cannot be used to
875
+ # refer to the price in future API calls.
876
+ # ### Adding adjustments
877
+ # To add adjustments, provide a list of objects with the key
878
+ # `add_adjustments`. An object in the list must include an object with
879
+ # the key `adjustment`, identical to the adjustment object in the
880
+ # [add/edit price intervals
881
+ # endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
882
+ # If the plan has phases, each object in the list must include a number with
883
+ # `plan_phase_order` key to indicate which phase the
884
+ # adjustment should be added to.
885
+ # An object in the list can specify an optional `start_date` and optional
886
+ # `end_date`. If `start_date` is unspecified, the start
887
+ # of the phase / plan change time will be used. If `end_date` is
888
+ # unspecified, it will finish at the end of the phase / have
889
+ # no end time.
890
+ # ### Removing adjustments
891
+ # To remove adjustments, provide a list of objects with the key
892
+ # `remove_adjustments`. An object in the list must include a key,
893
+ # `adjustment_id`, with the ID of the adjustment to be removed.
894
+ # ### Replacing adjustments
895
+ # To replace adjustments, provide a list of objects with the key
896
+ # `replace_adjustments`. An object in the list must specify a plan
897
+ # adjustment to replace with the `replaces_adjustment_id` key, and it must
898
+ # specify an adjustment to replace it with by including
899
+ # an object with the key `adjustment`, identical to the adjustment object in
900
+ # the
901
+ # [add/edit price intervals
902
+ # endpoint](/api-reference/price-interval/add-or-edit-price-intervals).
903
+ # The replacement adjustment will have the same phase, if applicable, and
904
+ # the same start and end dates as the adjustment it
905
+ # replaces.
906
+ # ## Price overrides (DEPRECATED)
907
+ # <Note>
908
+ # Price overrides are being phased out in favor adding/removing/replacing
909
+ # prices. (See
910
+ # [Customize your customer's
911
+ # subscriptions](/api-reference/subscription/schedule-plan-change))
912
+ # </Note>
913
+ # Price overrides are used to update some or all prices in a plan for the
914
+ # specific subscription being created. This is
915
+ # useful when a new customer has negotiated a rate that is unique to the
916
+ # customer.
917
+ # To override prices, provide a list of objects with the key
918
+ # `price_overrides`. The price object in the list of overrides
919
+ # is expected to contain the existing price id, the `model_type` and
920
+ # configuration.
921
+ # (See the [Price resource](/product-catalog/price-configuration)
922
+ # for the specification of different price model configurations.) The
923
+ # numerical values can be updated, but the billable metric,
924
+ # cadence, type, and name of a price can not be overridden.
925
+ # ### Maximums, and minimums
926
+ # Price overrides are used to update some or all prices in the target plan.
927
+ # Minimums and maximums, much like price
928
+ # overrides, can be useful when a new customer has negotiated a new or
929
+ # different minimum or maximum spend cap than the
930
+ # default for the plan. The request format for maximums and minimums is the
931
+ # same as those in
932
+ # [subscription creation](create-subscription).
933
+ # ## Scheduling multiple plan changes
934
+ # When scheduling multiple plan changes with the same date, the latest plan
935
+ # change on that day takes effect.
936
+ # ## Prorations for in-advance fees
937
+ # By default, Orb calculates the prorated difference in any fixed fees when
938
+ # making a plan change, adjusting the
939
+ # customer balance as needed. For details on this behavior, see
940
+ # [Modifying
941
+ # subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-
942
+ # advance-fees).
943
+ # @param [String] subscription_id Required parameter: TODO: type description
944
+ # here
945
+ # @param [SubscriptionPlanChange] body Required parameter: TODO: type
946
+ # description here
947
+ # @return [ApiResponse] Complete http response with raw body and status code.
948
+ def schedule_plan_change(subscription_id,
949
+ body)
950
+ @api_call
951
+ .request(new_request_builder(HttpMethodEnum::POST,
952
+ '/subscriptions/{subscription_id}/schedule_plan_change',
953
+ Server::DEFAULT)
954
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
955
+ .is_required(true)
956
+ .should_encode(true))
957
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
958
+ .body_param(new_parameter(body)
959
+ .is_required(true))
960
+ .header_param(new_parameter('application/json', key: 'accept'))
961
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
962
+ .auth(Single.new('APIKeyAuth')))
963
+ .response(new_response_handler
964
+ .deserializer(APIHelper.method(:custom_type_deserializer))
965
+ .deserialize_into(MutatedSubscription.method(:from_hash))
966
+ .is_api_response(true)
967
+ .local_error('400',
968
+ 'Bad Request',
969
+ APIException)
970
+ .local_error('401',
971
+ 'Unauthorized',
972
+ AuthorizationErrorException)
973
+ .local_error('404',
974
+ 'Not Found',
975
+ APIException)
976
+ .local_error('409',
977
+ 'Conflict',
978
+ IdempotencyRequestMismatchException)
979
+ .local_error('413',
980
+ 'Content Too Large',
981
+ APIException)
982
+ .local_error('429',
983
+ 'Too Many Requests',
984
+ TooManyRequestsException)
985
+ .local_error('500',
986
+ 'Internal Server Error',
987
+ ServerErrorException))
988
+ .execute
989
+ end
990
+
991
+ # Manually trigger a phase, effective the given date (or the current time,
992
+ # if not specified).
993
+ # @param [String] subscription_id Required parameter: TODO: type description
994
+ # here
995
+ # @param [TriggerSubscriptionPhaseParams] body Required parameter: TODO:
996
+ # type description here
997
+ # @return [ApiResponse] Complete http response with raw body and status code.
998
+ def trigger_phase(subscription_id,
999
+ body)
1000
+ @api_call
1001
+ .request(new_request_builder(HttpMethodEnum::POST,
1002
+ '/subscriptions/{subscription_id}/trigger_phase',
1003
+ Server::DEFAULT)
1004
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1005
+ .is_required(true)
1006
+ .should_encode(true))
1007
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1008
+ .body_param(new_parameter(body)
1009
+ .is_required(true))
1010
+ .header_param(new_parameter('application/json', key: 'accept'))
1011
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1012
+ .auth(Single.new('APIKeyAuth')))
1013
+ .response(new_response_handler
1014
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1015
+ .deserialize_into(MutatedSubscription.method(:from_hash))
1016
+ .is_api_response(true)
1017
+ .local_error('400',
1018
+ 'Bad Request',
1019
+ APIException)
1020
+ .local_error('401',
1021
+ 'Unauthorized',
1022
+ AuthorizationErrorException)
1023
+ .local_error('404',
1024
+ 'Not Found',
1025
+ APIException)
1026
+ .local_error('409',
1027
+ 'Conflict',
1028
+ IdempotencyRequestMismatchException)
1029
+ .local_error('413',
1030
+ 'Content Too Large',
1031
+ APIException)
1032
+ .local_error('429',
1033
+ 'Too Many Requests',
1034
+ TooManyRequestsException)
1035
+ .local_error('500',
1036
+ 'Internal Server Error',
1037
+ ServerErrorException))
1038
+ .execute
1039
+ end
1040
+
1041
+ # This endpoint can be used to unschedule any pending cancellations for a
1042
+ # subscription.
1043
+ # To be eligible, the subscription must currently be active and have a
1044
+ # future cancellation. This operation will turn
1045
+ # on auto-renew, ensuring that the subscription does not end at the
1046
+ # currently scheduled cancellation time.
1047
+ # Note: uncancellation is a lossy operation. Price intervals that were cut
1048
+ # short by the cancellation are extended
1049
+ # to infinity (original end dates are lost), and future intervals or phases
1050
+ # scheduled after the cancellation time
1051
+ # are permanently deleted. For complex subscriptions with phases or
1052
+ # scheduled plan changes, consider creating a new
1053
+ # plan change instead of uncancelling.
1054
+ # @param [String] subscription_id Required parameter: TODO: type description
1055
+ # here
1056
+ # @return [ApiResponse] Complete http response with raw body and status code.
1057
+ def unschedule_cancellation(subscription_id)
1058
+ @api_call
1059
+ .request(new_request_builder(HttpMethodEnum::POST,
1060
+ '/subscriptions/{subscription_id}/unschedule_cancellation',
1061
+ Server::DEFAULT)
1062
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1063
+ .is_required(true)
1064
+ .should_encode(true))
1065
+ .header_param(new_parameter('application/json', key: 'accept'))
1066
+ .auth(Single.new('APIKeyAuth')))
1067
+ .response(new_response_handler
1068
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1069
+ .deserialize_into(MutatedSubscription.method(:from_hash))
1070
+ .is_api_response(true)
1071
+ .local_error('400',
1072
+ 'Bad Request',
1073
+ APIException)
1074
+ .local_error('401',
1075
+ 'Unauthorized',
1076
+ AuthorizationErrorException)
1077
+ .local_error('404',
1078
+ 'Not Found',
1079
+ APIException)
1080
+ .local_error('409',
1081
+ 'Conflict',
1082
+ IdempotencyRequestMismatchException)
1083
+ .local_error('413',
1084
+ 'Content Too Large',
1085
+ APIException)
1086
+ .local_error('429',
1087
+ 'Too Many Requests',
1088
+ TooManyRequestsException)
1089
+ .local_error('500',
1090
+ 'Internal Server Error',
1091
+ ServerErrorException))
1092
+ .execute
1093
+ end
1094
+
1095
+ # This endpoint can be used to clear scheduled updates to the quantity for a
1096
+ # fixed fee.
1097
+ # If there are no updates scheduled, a request validation error will be
1098
+ # returned with a 400 status code.
1099
+ # @param [String] subscription_id Required parameter: TODO: type description
1100
+ # here
1101
+ # @param [UnscheduleFixedFeeQuantityChangeParams] body Required parameter:
1102
+ # TODO: type description here
1103
+ # @return [ApiResponse] Complete http response with raw body and status code.
1104
+ def unschedule_fixed_fee_quantity(subscription_id,
1105
+ body)
1106
+ @api_call
1107
+ .request(new_request_builder(HttpMethodEnum::POST,
1108
+ '/subscriptions/{subscription_id}/unschedule_fixed_fee_quantity_updates',
1109
+ Server::DEFAULT)
1110
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1111
+ .is_required(true)
1112
+ .should_encode(true))
1113
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1114
+ .body_param(new_parameter(body)
1115
+ .is_required(true))
1116
+ .header_param(new_parameter('application/json', key: 'accept'))
1117
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1118
+ .auth(Single.new('APIKeyAuth')))
1119
+ .response(new_response_handler
1120
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1121
+ .deserialize_into(MutatedSubscription.method(:from_hash))
1122
+ .is_api_response(true)
1123
+ .local_error('400',
1124
+ 'Bad Request',
1125
+ APIException)
1126
+ .local_error('401',
1127
+ 'Unauthorized',
1128
+ AuthorizationErrorException)
1129
+ .local_error('404',
1130
+ 'Not Found',
1131
+ APIException)
1132
+ .local_error('409',
1133
+ 'Conflict',
1134
+ IdempotencyRequestMismatchException)
1135
+ .local_error('413',
1136
+ 'Content Too Large',
1137
+ APIException)
1138
+ .local_error('429',
1139
+ 'Too Many Requests',
1140
+ TooManyRequestsException)
1141
+ .local_error('500',
1142
+ 'Internal Server Error',
1143
+ ServerErrorException))
1144
+ .execute
1145
+ end
1146
+
1147
+ # This endpoint can be used to unschedule any pending plan changes on an
1148
+ # existing subscription.
1149
+ # When called, all upcoming plan changes will be unscheduled.
1150
+ # @param [String] subscription_id Required parameter: TODO: type description
1151
+ # here
1152
+ # @return [ApiResponse] Complete http response with raw body and status code.
1153
+ def unschedule_plan_change(subscription_id)
1154
+ @api_call
1155
+ .request(new_request_builder(HttpMethodEnum::POST,
1156
+ '/subscriptions/{subscription_id}/unschedule_pending_plan_changes',
1157
+ Server::DEFAULT)
1158
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1159
+ .is_required(true)
1160
+ .should_encode(true))
1161
+ .header_param(new_parameter('application/json', key: 'accept'))
1162
+ .auth(Single.new('APIKeyAuth')))
1163
+ .response(new_response_handler
1164
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1165
+ .deserialize_into(MutatedSubscription.method(:from_hash))
1166
+ .is_api_response(true)
1167
+ .local_error('400',
1168
+ 'Bad Request',
1169
+ APIException)
1170
+ .local_error('401',
1171
+ 'Unauthorized',
1172
+ AuthorizationErrorException)
1173
+ .local_error('404',
1174
+ 'Not Found',
1175
+ APIException)
1176
+ .local_error('409',
1177
+ 'Conflict',
1178
+ IdempotencyRequestMismatchException)
1179
+ .local_error('413',
1180
+ 'Content Too Large',
1181
+ APIException)
1182
+ .local_error('429',
1183
+ 'Too Many Requests',
1184
+ TooManyRequestsException)
1185
+ .local_error('500',
1186
+ 'Internal Server Error',
1187
+ ServerErrorException))
1188
+ .execute
1189
+ end
1190
+
1191
+ # This endpoint can be used to update the quantity for a fixed fee.
1192
+ # To be eligible, the subscription must currently be active and the price
1193
+ # specified must be a fixed fee (not
1194
+ # usage-based). This operation will immediately update the quantity for the
1195
+ # fee, or if a `effective_date` is passed
1196
+ # in, will update the quantity on the requested date at midnight in the
1197
+ # customer's timezone.
1198
+ # In order to change the fixed fee quantity as of the next draft invoice for
1199
+ # this subscription, pass
1200
+ # `change_option=upcoming_invoice` without an `effective_date` specified.
1201
+ # If the fee is an in-advance fixed fee, it will also issue an immediate
1202
+ # invoice for the difference for the remainder
1203
+ # of the billing period.
1204
+ # @param [String] subscription_id Required parameter: TODO: type description
1205
+ # here
1206
+ # @param [FixedFeeQuantityChange] body Required parameter: TODO: type
1207
+ # description here
1208
+ # @return [ApiResponse] Complete http response with raw body and status code.
1209
+ def update_fixed_fee_quantity(subscription_id,
1210
+ body)
1211
+ @api_call
1212
+ .request(new_request_builder(HttpMethodEnum::POST,
1213
+ '/subscriptions/{subscription_id}/update_fixed_fee_quantity',
1214
+ Server::DEFAULT)
1215
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1216
+ .is_required(true)
1217
+ .should_encode(true))
1218
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1219
+ .body_param(new_parameter(body)
1220
+ .is_required(true))
1221
+ .header_param(new_parameter('application/json', key: 'accept'))
1222
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1223
+ .auth(Single.new('APIKeyAuth')))
1224
+ .response(new_response_handler
1225
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1226
+ .deserialize_into(MutatedSubscription.method(:from_hash))
1227
+ .is_api_response(true)
1228
+ .local_error('400',
1229
+ 'Bad Request',
1230
+ APIException)
1231
+ .local_error('401',
1232
+ 'Unauthorized',
1233
+ AuthorizationErrorException)
1234
+ .local_error('404',
1235
+ 'Not Found',
1236
+ APIException)
1237
+ .local_error('409',
1238
+ 'Conflict',
1239
+ IdempotencyRequestMismatchException)
1240
+ .local_error('413',
1241
+ 'Content Too Large',
1242
+ APIException)
1243
+ .local_error('429',
1244
+ 'Too Many Requests',
1245
+ TooManyRequestsException)
1246
+ .local_error('500',
1247
+ 'Internal Server Error',
1248
+ ServerErrorException))
1249
+ .execute
1250
+ end
1251
+
1252
+ # This endpoint is used to update the trial end date for a subscription. The
1253
+ # new trial end date must be within the time range
1254
+ # of the current plan (i.e. the new trial end date must be on or after the
1255
+ # subscription's start date on the current plan, and
1256
+ # on or before the subscription end date).
1257
+ # In order to retroactively remove a trial completely, the end date can be
1258
+ # set to the transition date of the subscription to this
1259
+ # plan (or, if this is the first plan for this subscription, the
1260
+ # subscription's start date). In order to end a trial immediately,
1261
+ # the keyword `immediate` can be provided as the trial end date.
1262
+ # By default, Orb will shift only the trial end date (and price intervals
1263
+ # that start or end on the previous trial end date), and
1264
+ # leave all other future price intervals untouched. If the `shift` parameter
1265
+ # is set to `true`, Orb will shift all subsequent
1266
+ # price and adjustment intervals by the same amount as the trial end date
1267
+ # shift (so, e.g., if a plan change is scheduled or an
1268
+ # add-on price was added, that change will be pushed back by the same amount
1269
+ # of time the trial is extended).
1270
+ # @param [String] subscription_id Required parameter: TODO: type description
1271
+ # here
1272
+ # @param [UpdateTrialRequestParams] body Required parameter: TODO: type
1273
+ # description here
1274
+ # @return [ApiResponse] Complete http response with raw body and status code.
1275
+ def update_trial(subscription_id,
1276
+ body)
1277
+ @api_call
1278
+ .request(new_request_builder(HttpMethodEnum::POST,
1279
+ '/subscriptions/{subscription_id}/update_trial',
1280
+ Server::DEFAULT)
1281
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1282
+ .is_required(true)
1283
+ .should_encode(true))
1284
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1285
+ .body_param(new_parameter(body)
1286
+ .is_required(true))
1287
+ .header_param(new_parameter('application/json', key: 'accept'))
1288
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1289
+ .auth(Single.new('APIKeyAuth')))
1290
+ .response(new_response_handler
1291
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1292
+ .deserialize_into(MutatedSubscription.method(:from_hash))
1293
+ .is_api_response(true)
1294
+ .local_error('400',
1295
+ 'Bad Request',
1296
+ APIException)
1297
+ .local_error('401',
1298
+ 'Unauthorized',
1299
+ AuthorizationErrorException)
1300
+ .local_error('404',
1301
+ 'Not Found',
1302
+ APIException)
1303
+ .local_error('409',
1304
+ 'Conflict',
1305
+ IdempotencyRequestMismatchException)
1306
+ .local_error('413',
1307
+ 'Content Too Large',
1308
+ APIException)
1309
+ .local_error('429',
1310
+ 'Too Many Requests',
1311
+ TooManyRequestsException)
1312
+ .local_error('500',
1313
+ 'Internal Server Error',
1314
+ ServerErrorException))
1315
+ .execute
1316
+ end
1317
+
1318
+ # This endpoint is used to fetch a subscription's usage in Orb. Especially
1319
+ # when combined with optional query
1320
+ # parameters, this endpoint is a powerful way to build visualizations on top
1321
+ # of Orb's event data and metrics.
1322
+ # With no query parameters specified, this endpoint returns usage for the
1323
+ # subscription's _current billing period_
1324
+ # across each billable metric that participates in the subscription. Usage
1325
+ # quantities returned are the result of
1326
+ # evaluating the metric definition for the entirety of the customer's
1327
+ # billing period.
1328
+ # ### Default response shape
1329
+ # Orb returns a `data` array with an object corresponding to each billable
1330
+ # metric. Nested within this object is a
1331
+ # `usage` array which has a `quantity` value and a corresponding
1332
+ # `timeframe_start` and `timeframe_end`. The `quantity`
1333
+ # value represents the calculated usage value for the billable metric over
1334
+ # the specified timeframe (inclusive of the
1335
+ # `timeframe_start` timestamp and exclusive of the `timeframe_end`
1336
+ # timestamp).
1337
+ # Orb will include _every_ window in the response starting from the
1338
+ # beginning of the billing period, even when there
1339
+ # were no events (and therefore no usage) in the window. This increases the
1340
+ # size of the response but prevents the caller
1341
+ # from filling in gaps and handling cumbersome time-based logic.
1342
+ # The query parameters in this endpoint serve to override this behavior and
1343
+ # provide some key functionality, as listed
1344
+ # below. Note that this functionality can also be used _in conjunction_ with
1345
+ # each other, e.g. to display grouped usage
1346
+ # on a custom timeframe.
1347
+ # ## Custom timeframe
1348
+ # In order to view usage for a custom timeframe rather than the current
1349
+ # billing period, specify a `timeframe_start` and
1350
+ # `timeframe_end`. This will calculate quantities for usage incurred between
1351
+ # timeframe_start (inclusive) and timeframe_end
1352
+ # (exclusive), i.e. `[timeframe_start, timeframe_end)`.
1353
+ # Note:
1354
+ # - These timestamps must be specified in ISO 8601 format and UTC timezone,
1355
+ # e.g. `2022-02-01T05:00:00Z`.
1356
+ # - Both parameters must be specified if either is specified.
1357
+ # ## Grouping by custom attributes
1358
+ # In order to view a single metric grouped by a specific _attribute_ that
1359
+ # each event is tagged with (e.g. `cluster`), you
1360
+ # must additionally specify a `billable_metric_id` and a `group_by` key. The
1361
+ # `group_by` key denotes the event property on
1362
+ # which to group.
1363
+ # When returning grouped usage, only usage for `billable_metric_id` is
1364
+ # returned, and a separate object in the `data` array
1365
+ # is returned for each value of the `group_by` key present in your events.
1366
+ # The `quantity` value is the result of evaluating
1367
+ # the billable metric for events filtered to a single value of the
1368
+ # `group_by` key.
1369
+ # Orb expects that events that match the billable metric will contain values
1370
+ # in the `properties` dictionary that correspond
1371
+ # to the `group_by` key specified. By default, Orb will not return a `null`
1372
+ # group (i.e. events that match the metric but
1373
+ # do not have the key set). Currently, it is only possible to view usage
1374
+ # grouped by a single attribute at a time.
1375
+ # When viewing grouped usage, Orb uses pagination to limit the response
1376
+ # size to 1000 groups by default. If there are more
1377
+ # groups for a given subscription, pagination metadata in the response can
1378
+ # be used to fetch all of the data.
1379
+ # The following example shows usage for an "API Requests" billable metric
1380
+ # grouped by `region`. Note the extra `metric_group`
1381
+ # dictionary in the response, which provides metadata about the group:
1382
+ # ```json
1383
+ # {
1384
+ # "data": [
1385
+ # {
1386
+ # "usage": [
1387
+ # {
1388
+ # "quantity": 0.19291,
1389
+ # "timeframe_start": "2021-10-01T07:00:00Z",
1390
+ # "timeframe_end": "2021-10-02T07:00:00Z",
1391
+ # },
1392
+ # ...
1393
+ # ],
1394
+ # "metric_group": {
1395
+ # "property_key": "region",
1396
+ # "property_value": "asia/pacific"
1397
+ # },
1398
+ # "billable_metric": {
1399
+ # "id": "Fe9pbpMk86xpwdGB",
1400
+ # "name": "API Requests"
1401
+ # },
1402
+ # "view_mode": "periodic"
1403
+ # },
1404
+ # ...
1405
+ # ]
1406
+ # }
1407
+ # ```
1408
+ # ## Windowed usage
1409
+ # The `granularity` parameter can be used to _window_ the usage `quantity`
1410
+ # value into periods. When not specified, usage
1411
+ # is returned for the entirety of the time range.
1412
+ # When `granularity = day` is specified with a timeframe longer than a day,
1413
+ # Orb will return a `quantity` value for each
1414
+ # full day between `timeframe_start` and `timeframe_end`. Note that the days
1415
+ # are demarcated by the _customer's local midnight_.
1416
+ # For example, with `timeframe_start = 2022-02-01T05:00:00Z`, `timeframe_end
1417
+ # = 2022-02-04T01:00:00Z` and `granularity=day`,
1418
+ # the following windows will be returned for a customer in the
1419
+ # `America/Los_Angeles` timezone since local midnight is `08:00` UTC:
1420
+ # - `[2022-02-01T05:00:00Z, 2022-02-01T08:00:00Z)`
1421
+ # - `[2022-02-01T08:00:00, 2022-02-02T08:00:00Z)`
1422
+ # - `[2022-02-02T08:00:00, 2022-02-03T08:00:00Z)`
1423
+ # - `[2022-02-03T08:00:00, 2022-02-04T01:00:00Z)`
1424
+ # ```json
1425
+ # {
1426
+ # "data": [
1427
+ # {
1428
+ # "billable_metric": {
1429
+ # "id": "Q8w89wjTtBdejXKsm",
1430
+ # "name": "API Requests"
1431
+ # },
1432
+ # "usage": [
1433
+ # {
1434
+ # "quantity": 0,
1435
+ # "timeframe_end": "2022-02-01T08:00:00+00:00",
1436
+ # "timeframe_start": "2022-02-01T05:00:00+00:00"
1437
+ # },
1438
+ # {
1439
+ # "quantity": 0,
1440
+ # "timeframe_end": "2022-02-02T08:00:00+00:00",
1441
+ # "timeframe_start": "2022-02-01T08:00:00+00:00"
1442
+ # },
1443
+ # {
1444
+ # "quantity": 0,
1445
+ # "timeframe_end": "2022-02-03T08:00:00+00:00",
1446
+ # "timeframe_start": "2022-02-02T08:00:00+00:00"
1447
+ # },
1448
+ # {
1449
+ # "quantity": 0,
1450
+ # "timeframe_end": "2022-02-04T01:00:00+00:00",
1451
+ # "timeframe_start": "2022-02-03T08:00:00+00:00"
1452
+ # }
1453
+ # ],
1454
+ # "view_mode": "periodic"
1455
+ # },
1456
+ # ...
1457
+ # ]
1458
+ # }
1459
+ # ```
1460
+ # ## Decomposable vs. non-decomposable metrics
1461
+ # Billable metrics fall into one of two categories: decomposable and
1462
+ # non-decomposable. A decomposable billable metric, such as
1463
+ # a sum or a count, can be displayed and aggregated across arbitrary
1464
+ # timescales. On the other hand, a non-decomposable metric
1465
+ # is not meaningful when only a slice of the billing window is considered.
1466
+ # As an example, if we have a billable metric that's defined to count unique
1467
+ # users, displaying a graph of unique users for each
1468
+ # day is not representative of the billable metric value over the month
1469
+ # (days could have an overlapping set of 'unique' users).
1470
+ # Instead, what's useful for any given day is the number of unique users in
1471
+ # the billing period so far, which are the
1472
+ # _cumulative_ unique users.
1473
+ # Accordingly, this endpoint returns treats these two types of metrics
1474
+ # differently when `group_by` is specified:
1475
+ # - Decomposable metrics can be grouped by any event property.
1476
+ # - Non-decomposable metrics can only be grouped by the corresponding
1477
+ # price's invoice grouping key. If no invoice grouping key
1478
+ # is present, the metric does not support `group_by`.
1479
+ # ## Matrix prices
1480
+ # When a billable metric is attached to a price that uses matrix pricing,
1481
+ # it's important to view usage grouped by those matrix
1482
+ # dimensions. In this case, use the query parameters `first_dimension_key`,
1483
+ # `first_dimension_value` and `second_dimension_key`,
1484
+ # `second_dimension_value` while filtering to a specific
1485
+ # `billable_metric_id`.
1486
+ # For example, if your compute metric has a separate unit price (i.e. a
1487
+ # matrix pricing model) per `region` and `provider`,
1488
+ # your request might provide the following parameters:
1489
+ # - `first_dimension_key`: `region`
1490
+ # - `first_dimension_value`: `us-east-1`
1491
+ # - `second_dimension_key`: `provider`
1492
+ # - `second_dimension_value`: `aws`
1493
+ # @param [String] subscription_id Required parameter: TODO: type description
1494
+ # here
1495
+ # @param [Granularity] granularity Optional parameter: Example:day
1496
+ # @param [DateTime] timeframe_start Optional parameter: TODO: type
1497
+ # description here
1498
+ # @param [DateTime] timeframe_end Optional parameter: TODO: type description
1499
+ # here
1500
+ # @param [String] billable_metric_id Optional parameter: TODO: type
1501
+ # description here
1502
+ # @param [String] group_by Optional parameter: TODO: type description here
1503
+ # @param [ViewMode] view_mode Optional parameter: Example:
1504
+ # @param [String] first_dimension_key Optional parameter: TODO: type
1505
+ # description here
1506
+ # @param [String] first_dimension_value Optional parameter: TODO: type
1507
+ # description here
1508
+ # @param [String] second_dimension_key Optional parameter: TODO: type
1509
+ # description here
1510
+ # @param [String] second_dimension_value Optional parameter: TODO: type
1511
+ # description here
1512
+ # @return [ApiResponse] Complete http response with raw body and status code.
1513
+ def fetch_subscription_usage(subscription_id,
1514
+ granularity: Granularity::DAY,
1515
+ timeframe_start: nil,
1516
+ timeframe_end: nil,
1517
+ billable_metric_id: nil,
1518
+ group_by: nil,
1519
+ view_mode: nil,
1520
+ first_dimension_key: nil,
1521
+ first_dimension_value: nil,
1522
+ second_dimension_key: nil,
1523
+ second_dimension_value: nil)
1524
+ @api_call
1525
+ .request(new_request_builder(HttpMethodEnum::GET,
1526
+ '/subscriptions/{subscription_id}/usage',
1527
+ Server::DEFAULT)
1528
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1529
+ .is_required(true)
1530
+ .should_encode(true))
1531
+ .query_param(new_parameter(granularity, key: 'granularity'))
1532
+ .query_param(new_parameter(timeframe_start, key: 'timeframe_start'))
1533
+ .query_param(new_parameter(timeframe_end, key: 'timeframe_end'))
1534
+ .query_param(new_parameter(billable_metric_id, key: 'billable_metric_id'))
1535
+ .query_param(new_parameter(group_by, key: 'group_by'))
1536
+ .query_param(new_parameter(view_mode, key: 'view_mode'))
1537
+ .query_param(new_parameter(first_dimension_key, key: 'first_dimension_key'))
1538
+ .query_param(new_parameter(first_dimension_value, key: 'first_dimension_value'))
1539
+ .query_param(new_parameter(second_dimension_key, key: 'second_dimension_key'))
1540
+ .query_param(new_parameter(second_dimension_value, key: 'second_dimension_value'))
1541
+ .header_param(new_parameter('application/json', key: 'accept'))
1542
+ .auth(Single.new('APIKeyAuth')))
1543
+ .response(new_response_handler
1544
+ .deserializer(proc do |response, should_symbolize|
1545
+ APIHelper.deserialize_union_type(
1546
+ UnionTypeLookUp.get(:SubscriptionUsage),
1547
+ response, should_symbolize, true
1548
+ )
1549
+ end)
1550
+ .is_api_response(true)
1551
+ .local_error('400',
1552
+ 'Bad Request',
1553
+ APIException)
1554
+ .local_error('401',
1555
+ 'Unauthorized',
1556
+ AuthorizationErrorException)
1557
+ .local_error('404',
1558
+ 'Not Found',
1559
+ APIException)
1560
+ .local_error('409',
1561
+ 'Conflict',
1562
+ IdempotencyRequestMismatchException)
1563
+ .local_error('413',
1564
+ 'Content Too Large',
1565
+ APIException)
1566
+ .local_error('429',
1567
+ 'Too Many Requests',
1568
+ TooManyRequestsException)
1569
+ .local_error('500',
1570
+ 'Internal Server Error',
1571
+ ServerErrorException))
1572
+ .execute
1573
+ end
1574
+ end
1575
+ end