schematichq 1.4.0 → 1.4.2

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 (279) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -4
  3. data/.fern/replay.lock +10 -0
  4. data/.fernignore +3 -0
  5. data/README.md +1 -1
  6. data/lib/schematic/accounts/client.rb +76 -0
  7. data/lib/schematic/accounts/types/get_account_member_response.rb +12 -0
  8. data/lib/schematic/accounts/types/list_account_members_params.rb +15 -0
  9. data/lib/schematic/accounts/types/list_account_members_request.rb +14 -0
  10. data/lib/schematic/accounts/types/list_account_members_response.rb +12 -0
  11. data/lib/schematic/billing/client.rb +6 -2
  12. data/lib/schematic/billing/types/count_billing_products_params.rb +1 -0
  13. data/lib/schematic/billing/types/count_billing_products_request.rb +1 -0
  14. data/lib/schematic/billing/types/create_billing_price_request_body.rb +2 -0
  15. data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +1 -0
  16. data/lib/schematic/billing/types/create_meter_request_body.rb +1 -0
  17. data/lib/schematic/billing/types/list_billing_products_params.rb +1 -0
  18. data/lib/schematic/billing/types/list_billing_products_request.rb +1 -0
  19. data/lib/schematic/cache.rb +7 -4
  20. data/lib/schematic/client.rb +14 -4
  21. data/lib/schematic/companies/client.rb +8 -105
  22. data/lib/schematic/companies/types/count_companies_params.rb +1 -0
  23. data/lib/schematic/companies/types/count_companies_request.rb +1 -0
  24. data/lib/schematic/companies/types/list_companies_params.rb +1 -0
  25. data/lib/schematic/companies/types/list_companies_request.rb +1 -0
  26. data/lib/schematic/companies/types/list_plan_changes_params.rb +2 -2
  27. data/lib/schematic/companies/types/list_plan_changes_request.rb +2 -2
  28. data/lib/schematic/credits/client.rb +44 -2
  29. data/lib/schematic/credits/types/count_billing_plan_credit_grants_params.rb +1 -0
  30. data/lib/schematic/credits/types/count_billing_plan_credit_grants_request.rb +1 -0
  31. data/lib/schematic/credits/types/list_billing_plan_credit_grants_params.rb +1 -0
  32. data/lib/schematic/credits/types/list_billing_plan_credit_grants_request.rb +1 -0
  33. data/lib/schematic/credits/types/list_company_credit_balances_params.rb +12 -0
  34. data/lib/schematic/credits/types/list_company_credit_balances_request.rb +11 -0
  35. data/lib/schematic/credits/types/list_company_credit_balances_response.rb +12 -0
  36. data/lib/schematic/datastream/client.rb +28 -21
  37. data/lib/schematic/datastream/websocket_client.rb +32 -1
  38. data/lib/schematic/entitlements/client.rb +38 -2
  39. data/lib/schematic/entitlements/types/count_feature_usage_params.rb +1 -0
  40. data/lib/schematic/entitlements/types/count_feature_usage_request.rb +1 -0
  41. data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +44 -0
  42. data/lib/schematic/entitlements/types/create_company_override_request_body.rb +2 -2
  43. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +6 -2
  44. data/lib/schematic/entitlements/types/list_feature_usage_params.rb +1 -0
  45. data/lib/schematic/entitlements/types/list_feature_usage_request.rb +1 -0
  46. data/lib/schematic/entitlements/types/update_company_override_request_body.rb +2 -2
  47. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +6 -2
  48. data/lib/schematic/entitlements/types/upsert_plan_entitlement_for_billing_product_response.rb +12 -0
  49. data/lib/schematic/event_buffer.rb +10 -2
  50. data/lib/schematic/events/client.rb +3 -1
  51. data/lib/schematic/events/types/list_events_params.rb +1 -0
  52. data/lib/schematic/events/types/list_events_request.rb +1 -0
  53. data/lib/schematic/features/client.rb +50 -14
  54. data/lib/schematic/features/types/count_features_params.rb +1 -0
  55. data/lib/schematic/features/types/count_features_request.rb +4 -3
  56. data/lib/schematic/features/types/create_billing_linked_feature_request_body.rb +23 -0
  57. data/lib/schematic/features/types/create_feature_request_body.rb +1 -1
  58. data/lib/schematic/features/types/list_features_params.rb +1 -0
  59. data/lib/schematic/features/types/list_features_request.rb +4 -3
  60. data/lib/schematic/features/types/update_feature_request_body.rb +1 -1
  61. data/lib/schematic/features/types/upsert_feature_for_billing_product_response.rb +12 -0
  62. data/lib/schematic/insights/client.rb +251 -0
  63. data/lib/schematic/insights/types/get_activity_params.rb +12 -0
  64. data/lib/schematic/insights/types/get_activity_request.rb +11 -0
  65. data/lib/schematic/insights/types/get_activity_response.rb +12 -0
  66. data/lib/schematic/insights/types/get_environment_feature_usage_time_series_params.rb +15 -0
  67. data/lib/schematic/insights/types/get_environment_feature_usage_time_series_request.rb +14 -0
  68. data/lib/schematic/insights/types/get_environment_feature_usage_time_series_response.rb +12 -0
  69. data/lib/schematic/insights/types/get_environment_trait_usage_time_series_params.rb +15 -0
  70. data/lib/schematic/insights/types/get_environment_trait_usage_time_series_request.rb +14 -0
  71. data/lib/schematic/insights/types/get_environment_trait_usage_time_series_response.rb +12 -0
  72. data/lib/schematic/insights/types/get_plan_growth_params.rb +12 -0
  73. data/lib/schematic/insights/types/get_plan_growth_request.rb +11 -0
  74. data/lib/schematic/insights/types/get_plan_growth_response.rb +12 -0
  75. data/lib/schematic/{companies/types/create_plan_trait_response.rb → insights/types/get_summary_response.rb} +3 -3
  76. data/lib/schematic/insights/types/get_top_features_by_usage_params.rb +14 -0
  77. data/lib/schematic/insights/types/get_top_features_by_usage_request.rb +13 -0
  78. data/lib/schematic/insights/types/get_top_features_by_usage_response.rb +12 -0
  79. data/lib/schematic/integrationsapi/client.rb +223 -0
  80. data/lib/schematic/integrationsapi/types/get_integration_webhook_url_response.rb +12 -0
  81. data/lib/schematic/integrationsapi/types/list_integrations_params.rb +18 -0
  82. data/lib/schematic/integrationsapi/types/list_integrations_request.rb +17 -0
  83. data/lib/schematic/integrationsapi/types/list_integrations_response.rb +12 -0
  84. data/lib/schematic/integrationsapi/types/load_sample_data_set_v_2_response.rb +12 -0
  85. data/lib/schematic/integrationsapi/types/run_integration_response.rb +12 -0
  86. data/lib/schematic/integrationsapi/types/start_data_import_request_body.rb +13 -0
  87. data/lib/schematic/integrationsapi/types/start_data_import_response.rb +12 -0
  88. data/lib/schematic/{companies/types/delete_plan_trait_response.rb → integrationsapi/types/uninstall_integration_response.rb} +2 -2
  89. data/lib/schematic/planbundle/client.rb +32 -0
  90. data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +13 -0
  91. data/lib/schematic/planbundle/types/create_custom_plan_bundle_response.rb +12 -0
  92. data/lib/schematic/plans/client.rb +251 -2
  93. data/lib/schematic/plans/types/count_billing_product_match_companies_params.rb +15 -0
  94. data/lib/schematic/plans/types/count_billing_product_match_companies_request.rb +14 -0
  95. data/lib/schematic/plans/types/count_billing_product_match_companies_response.rb +12 -0
  96. data/lib/schematic/plans/types/count_plans_params.rb +3 -0
  97. data/lib/schematic/plans/types/count_plans_request.rb +3 -0
  98. data/lib/schematic/plans/types/create_billing_linked_plan_request_body.rb +17 -0
  99. data/lib/schematic/plans/types/create_custom_plan_request_body.rb +15 -0
  100. data/lib/schematic/{companies/types/update_plan_trait_response.rb → plans/types/create_custom_plan_response.rb} +3 -3
  101. data/lib/schematic/plans/types/list_billing_product_match_companies_params.rb +15 -0
  102. data/lib/schematic/plans/types/list_billing_product_match_companies_request.rb +14 -0
  103. data/lib/schematic/plans/types/list_billing_product_match_companies_response.rb +12 -0
  104. data/lib/schematic/plans/types/list_custom_plan_billings_params.rb +17 -0
  105. data/lib/schematic/plans/types/list_custom_plan_billings_request.rb +16 -0
  106. data/lib/schematic/plans/types/list_custom_plan_billings_response.rb +12 -0
  107. data/lib/schematic/plans/types/list_plans_params.rb +3 -0
  108. data/lib/schematic/plans/types/list_plans_request.rb +3 -0
  109. data/lib/schematic/plans/types/publish_plan_version_request_body.rb +4 -0
  110. data/lib/schematic/plans/types/retry_custom_plan_billing_request_body.rb +15 -0
  111. data/lib/schematic/plans/types/retry_custom_plan_billing_response.rb +12 -0
  112. data/lib/schematic/plans/types/upsert_plan_for_billing_product_response.rb +12 -0
  113. data/lib/schematic/redis_cache.rb +5 -2
  114. data/lib/schematic/schematic_client.rb +0 -1
  115. data/lib/schematic/types/account_member_permission.rb +25 -0
  116. data/lib/schematic/types/account_member_response_data.rb +16 -0
  117. data/lib/schematic/types/{rulesengine_company_metric_month_reset.rb → account_member_role.rb} +3 -3
  118. data/lib/schematic/types/activity_entry_response_data.rb +14 -0
  119. data/lib/schematic/types/activity_response_response_data.rb +9 -0
  120. data/lib/schematic/types/api_key_create_response_data.rb +2 -0
  121. data/lib/schematic/types/api_key_integration_response_data.rb +11 -0
  122. data/lib/schematic/types/api_key_response_data.rb +2 -0
  123. data/lib/schematic/types/audit_log_list_response_data.rb +2 -0
  124. data/lib/schematic/types/audit_log_response_data.rb +2 -0
  125. data/lib/schematic/types/billing_credit_bundle_view.rb +1 -1
  126. data/lib/schematic/types/billing_credit_view.rb +1 -0
  127. data/lib/schematic/types/billing_linked_resource_response_data.rb +11 -0
  128. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +2 -0
  129. data/lib/schematic/types/billing_price_response_data.rb +2 -0
  130. data/lib/schematic/types/billing_price_view.rb +2 -0
  131. data/lib/schematic/types/billing_product_for_subscription_response_data.rb +1 -0
  132. data/lib/schematic/types/billing_product_plan_response_data.rb +2 -1
  133. data/lib/schematic/types/billing_product_price_response_data.rb +2 -0
  134. data/lib/schematic/types/billing_provider_type.rb +1 -0
  135. data/lib/schematic/types/billing_strategy.rb +13 -0
  136. data/lib/schematic/types/change_subscription_internal_request_body.rb +1 -0
  137. data/lib/schematic/types/change_subscription_request_body.rb +1 -0
  138. data/lib/schematic/types/charge_type.rb +1 -0
  139. data/lib/schematic/types/check_flag_response_data.rb +2 -2
  140. data/lib/schematic/types/checkout_subscription.rb +1 -0
  141. data/lib/schematic/types/clerk_integration_config.rb +10 -0
  142. data/lib/schematic/types/company_credit_balance_response_data.rb +12 -0
  143. data/lib/schematic/types/company_detail_response_data.rb +1 -0
  144. data/lib/schematic/types/company_event_period_metrics_response_data.rb +2 -2
  145. data/lib/schematic/types/company_matching_criteria.rb +12 -0
  146. data/lib/schematic/types/company_override_response_data.rb +2 -2
  147. data/lib/schematic/types/company_plan_credit_grant_view.rb +40 -0
  148. data/lib/schematic/types/company_plan_detail_response_data.rb +9 -3
  149. data/lib/schematic/types/company_plan_with_billing_sub_view.rb +1 -1
  150. data/lib/schematic/types/company_subscription_response_data.rb +1 -0
  151. data/lib/schematic/types/{condition_operator.rb → comparable_operator.rb} +4 -4
  152. data/lib/schematic/types/condition.rb +4 -4
  153. data/lib/schematic/types/condition_response_data.rb +4 -4
  154. data/lib/schematic/types/{condition_condition_type.rb → condition_type.rb} +1 -1
  155. data/lib/schematic/types/condition_view.rb +4 -4
  156. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +2 -0
  157. data/lib/schematic/types/create_custom_plan_bundle_plan_request_body.rb +12 -0
  158. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +6 -2
  159. data/lib/schematic/types/create_entitlement_req_common.rb +2 -2
  160. data/lib/schematic/types/create_event_request_body.rb +3 -0
  161. data/lib/schematic/types/create_flag_request_body.rb +1 -1
  162. data/lib/schematic/types/create_or_update_condition_request_body.rb +4 -4
  163. data/lib/schematic/types/create_or_update_flag_request_body.rb +1 -1
  164. data/lib/schematic/types/create_or_update_rule_request_body.rb +1 -1
  165. data/lib/schematic/types/create_plan_request_body.rb +1 -1
  166. data/lib/schematic/types/credit_currency_price.rb +10 -0
  167. data/lib/schematic/types/currency_price_request_body.rb +3 -0
  168. data/lib/schematic/types/custom_plan_activation_strategy.rb +12 -0
  169. data/lib/schematic/types/custom_plan_billing_response_data.rb +19 -0
  170. data/lib/schematic/types/custom_plan_billing_status.rb +14 -0
  171. data/lib/schematic/types/data_event_payload.rb +3 -0
  172. data/lib/schematic/types/datastream_company_plan.rb +1 -0
  173. data/lib/schematic/types/duplicate_plan_entitlements_response_response_data.rb +1 -0
  174. data/lib/schematic/types/entitlement_currency_prices_response_data.rb +1 -0
  175. data/lib/schematic/types/environment_feature_usage_time_series_response_data.rb +11 -0
  176. data/lib/schematic/types/environment_trait_usage_time_series_response_data.rb +11 -0
  177. data/lib/schematic/types/environment_usage_point_response_data.rb +10 -0
  178. data/lib/schematic/types/event_detail_response_data.rb +2 -0
  179. data/lib/schematic/types/event_response_data.rb +1 -0
  180. data/lib/schematic/types/feature_company_response_data.rb +4 -3
  181. data/lib/schematic/types/feature_company_user_response_data.rb +2 -2
  182. data/lib/schematic/types/feature_detail_response_data.rb +3 -1
  183. data/lib/schematic/types/feature_entitlement.rb +2 -2
  184. data/lib/schematic/types/feature_in_plan_response_data.rb +26 -0
  185. data/lib/schematic/types/feature_response_data.rb +1 -1
  186. data/lib/schematic/types/feature_usage_response_data.rb +4 -3
  187. data/lib/schematic/types/feature_view.rb +1 -1
  188. data/lib/schematic/types/flag_detail_response_data.rb +2 -1
  189. data/lib/schematic/types/flag_in_plan_response_data.rb +21 -0
  190. data/lib/schematic/types/flag_response_data.rb +1 -1
  191. data/lib/schematic/types/flag_view.rb +0 -1
  192. data/lib/schematic/types/insights_summary_response_data.rb +14 -0
  193. data/lib/schematic/types/integration_capabilities.rb +11 -0
  194. data/lib/schematic/types/integration_config.rb +15 -0
  195. data/lib/schematic/types/integration_response_data.rb +13 -0
  196. data/lib/schematic/types/integration_state.rb +13 -0
  197. data/lib/schematic/types/{plan_controlled_by_type.rb → integration_type.rb} +4 -2
  198. data/lib/schematic/types/integration_webhook_url_response_data.rb +10 -0
  199. data/lib/schematic/types/integrations_data_set_response_data.rb +9 -0
  200. data/lib/schematic/types/integrations_list_response_data.rb +15 -0
  201. data/lib/schematic/types/integrations_response_data.rb +13 -0
  202. data/lib/schematic/types/{condition_metric_period.rb → metric_period.rb} +1 -1
  203. data/lib/schematic/types/{feature_entitlement_month_reset.rb → metric_period_month_reset.rb} +2 -2
  204. data/lib/schematic/types/mrr_response_data.rb +10 -0
  205. data/lib/schematic/types/orb_integration_config.rb +9 -0
  206. data/lib/schematic/types/plan_credit_grant_view.rb +2 -0
  207. data/lib/schematic/types/plan_currency_price_request_body.rb +1 -0
  208. data/lib/schematic/types/plan_currency_prices_response_data.rb +1 -0
  209. data/lib/schematic/types/plan_detail_response_data.rb +9 -3
  210. data/lib/schematic/types/plan_entitlement_response_data.rb +4 -2
  211. data/lib/schematic/types/plan_group_plan_detail_response_data.rb +9 -3
  212. data/lib/schematic/types/plan_growth_point_response_data.rb +12 -0
  213. data/lib/schematic/types/plan_growth_response_data.rb +9 -0
  214. data/lib/schematic/types/plan_icon.rb +35 -0
  215. data/lib/schematic/types/plan_response_data.rb +3 -1
  216. data/lib/schematic/types/plan_version_response_data.rb +1 -1
  217. data/lib/schematic/types/plan_view_public_response_data.rb +9 -3
  218. data/lib/schematic/types/rule.rb +1 -1
  219. data/lib/schematic/types/rule_condition_detail_response_data.rb +4 -4
  220. data/lib/schematic/types/rule_condition_response_data.rb +4 -4
  221. data/lib/schematic/types/rule_detail_response_data.rb +1 -1
  222. data/lib/schematic/types/rule_response_data.rb +1 -1
  223. data/lib/schematic/types/{rule_rule_type.rb → rule_type.rb} +3 -3
  224. data/lib/schematic/types/rule_view.rb +1 -1
  225. data/lib/schematic/types/rules_engine_schema_version.rb +1 -1
  226. data/lib/schematic/types/rulesengine_check_flag_result.rb +2 -2
  227. data/lib/schematic/types/rulesengine_company_metric.rb +2 -2
  228. data/lib/schematic/types/rulesengine_condition.rb +4 -4
  229. data/lib/schematic/types/{rulesengine_condition_condition_type.rb → rulesengine_condition_type.rb} +1 -1
  230. data/lib/schematic/types/rulesengine_feature_entitlement.rb +2 -2
  231. data/lib/schematic/types/{feature_entitlement_metric_period.rb → rulesengine_metric_period.rb} +1 -1
  232. data/lib/schematic/types/{condition_metric_period_month_reset.rb → rulesengine_metric_period_month_reset.rb} +2 -2
  233. data/lib/schematic/types/rulesengine_rule.rb +1 -1
  234. data/lib/schematic/types/{rulesengine_rule_rule_type.rb → rulesengine_rule_type.rb} +3 -3
  235. data/lib/schematic/types/stripe_integration_config.rb +15 -0
  236. data/lib/schematic/types/top_feature_by_usage_response_data.rb +14 -0
  237. data/lib/schematic/types/top_features_by_usage_response_data.rb +9 -0
  238. data/lib/schematic/types/trial_status.rb +13 -0
  239. data/lib/schematic/types/update_auto_topup_override_request_body.rb +12 -0
  240. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +2 -0
  241. data/lib/schematic/types/update_entitlement_req_common.rb +2 -2
  242. data/lib/schematic/types/update_plan_request_body.rb +1 -1
  243. data/lib/schematic/types/upsert_billing_product_request_body.rb +3 -0
  244. data/lib/schematic/types/usage_based_entitlement_request_body.rb +4 -0
  245. data/lib/schematic/types/usage_based_entitlement_response_data.rb +3 -2
  246. data/lib/schematic/types/webhook_url.rb +10 -0
  247. data/lib/schematic/version.rb +1 -1
  248. data/lib/schematic.rb +121 -57
  249. data/reference.md +2910 -886
  250. metadata +110 -45
  251. data/lib/schematic/companies/types/create_plan_trait_request_body.rb +0 -13
  252. data/lib/schematic/companies/types/update_plan_trait_request_body.rb +0 -13
  253. data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period.rb +0 -16
  254. data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period_month_reset.rb +0 -14
  255. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.rb +0 -16
  256. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period_month_reset.rb +0 -14
  257. data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period.rb +0 -16
  258. data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period_month_reset.rb +0 -14
  259. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.rb +0 -16
  260. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period_month_reset.rb +0 -14
  261. data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period.rb +0 -14
  262. data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.rb +0 -12
  263. data/lib/schematic/types/create_entitlement_req_common_metric_period.rb +0 -14
  264. data/lib/schematic/types/create_entitlement_req_common_metric_period_month_reset.rb +0 -12
  265. data/lib/schematic/types/create_or_update_condition_request_body_condition_type.rb +0 -17
  266. data/lib/schematic/types/create_or_update_condition_request_body_metric_period.rb +0 -14
  267. data/lib/schematic/types/create_or_update_condition_request_body_metric_period_month_reset.rb +0 -12
  268. data/lib/schematic/types/create_or_update_condition_request_body_operator.rb +0 -18
  269. data/lib/schematic/types/create_or_update_rule_request_body_rule_type.rb +0 -15
  270. data/lib/schematic/types/rulesengine_check_flag_result_feature_usage_period.rb +0 -14
  271. data/lib/schematic/types/rulesengine_check_flag_result_rule_type.rb +0 -17
  272. data/lib/schematic/types/rulesengine_company_metric_period.rb +0 -14
  273. data/lib/schematic/types/rulesengine_condition_metric_period.rb +0 -14
  274. data/lib/schematic/types/rulesengine_condition_metric_period_month_reset.rb +0 -12
  275. data/lib/schematic/types/rulesengine_condition_operator.rb +0 -18
  276. data/lib/schematic/types/rulesengine_feature_entitlement_metric_period.rb +0 -14
  277. data/lib/schematic/types/rulesengine_feature_entitlement_month_reset.rb +0 -12
  278. data/lib/schematic/types/update_entitlement_req_common_metric_period.rb +0 -14
  279. data/lib/schematic/types/update_entitlement_req_common_metric_period_month_reset.rb +0 -12
@@ -55,6 +55,125 @@ module Schematic
55
55
  # @option request_options [Hash{String => Object}] :additional_body_parameters
56
56
  # @option request_options [Integer] :timeout_in_seconds
57
57
  # @option params [String, nil] :company_id
58
+ # @option params [String, nil] :plan_id
59
+ # @option params [Schematic::Types::CustomPlanBillingStatus, nil] :status
60
+ # @option params [Schematic::Types::CustomPlanBillingStatus, nil] :statuses
61
+ # @option params [Integer, nil] :limit
62
+ # @option params [Integer, nil] :offset
63
+ #
64
+ # @return [Schematic::Plans::Types::ListCustomPlanBillingsResponse]
65
+ def list_custom_plan_billings(request_options: {}, **params)
66
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
67
+ query_param_names = %i[company_id plan_id status statuses limit offset]
68
+ query_params = {}
69
+ query_params["company_id"] = params[:company_id] if params.key?(:company_id)
70
+ query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
71
+ query_params["status"] = params[:status] if params.key?(:status)
72
+ query_params["statuses"] = params[:statuses] if params.key?(:statuses)
73
+ query_params["limit"] = params[:limit] if params.key?(:limit)
74
+ query_params["offset"] = params[:offset] if params.key?(:offset)
75
+ params.except(*query_param_names)
76
+
77
+ request = Schematic::Internal::JSON::Request.new(
78
+ base_url: request_options[:base_url],
79
+ method: "GET",
80
+ path: "custom-plan-billings",
81
+ query: query_params,
82
+ request_options: request_options
83
+ )
84
+ begin
85
+ response = @client.send(request)
86
+ rescue Net::HTTPRequestTimeout
87
+ raise Schematic::Errors::TimeoutError
88
+ end
89
+ code = response.code.to_i
90
+ if code.between?(200, 299)
91
+ Schematic::Plans::Types::ListCustomPlanBillingsResponse.load(response.body)
92
+ else
93
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
94
+ raise error_class.new(response.body, code: code)
95
+ end
96
+ end
97
+
98
+ # @param request_options [Hash]
99
+ # @param params [Schematic::Plans::Types::RetryCustomPlanBillingRequestBody]
100
+ # @option request_options [String] :base_url
101
+ # @option request_options [Hash{String => Object}] :additional_headers
102
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
103
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
104
+ # @option request_options [Integer] :timeout_in_seconds
105
+ # @option params [String] :custom_plan_billing_id
106
+ #
107
+ # @return [Schematic::Plans::Types::RetryCustomPlanBillingResponse]
108
+ def retry_custom_plan_billing(request_options: {}, **params)
109
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
110
+ request_data = Schematic::Plans::Types::RetryCustomPlanBillingRequestBody.new(params).to_h
111
+ non_body_param_names = ["custom_plan_billing_id"]
112
+ body = request_data.except(*non_body_param_names)
113
+
114
+ request = Schematic::Internal::JSON::Request.new(
115
+ base_url: request_options[:base_url],
116
+ method: "PUT",
117
+ path: "custom-plan-billings/#{URI.encode_uri_component(params[:custom_plan_billing_id].to_s)}/retry",
118
+ body: body,
119
+ request_options: request_options
120
+ )
121
+ begin
122
+ response = @client.send(request)
123
+ rescue Net::HTTPRequestTimeout
124
+ raise Schematic::Errors::TimeoutError
125
+ end
126
+ code = response.code.to_i
127
+ if code.between?(200, 299)
128
+ Schematic::Plans::Types::RetryCustomPlanBillingResponse.load(response.body)
129
+ else
130
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
131
+ raise error_class.new(response.body, code: code)
132
+ end
133
+ end
134
+
135
+ # @param request_options [Hash]
136
+ # @param params [Schematic::Plans::Types::CreateCustomPlanRequestBody]
137
+ # @option request_options [String] :base_url
138
+ # @option request_options [Hash{String => Object}] :additional_headers
139
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
140
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
141
+ # @option request_options [Integer] :timeout_in_seconds
142
+ #
143
+ # @return [Schematic::Plans::Types::CreateCustomPlanResponse]
144
+ def create_custom_plan(request_options: {}, **params)
145
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
146
+ request = Schematic::Internal::JSON::Request.new(
147
+ base_url: request_options[:base_url],
148
+ method: "POST",
149
+ path: "custom-plans",
150
+ body: Schematic::Plans::Types::CreateCustomPlanRequestBody.new(params).to_h,
151
+ request_options: request_options
152
+ )
153
+ begin
154
+ response = @client.send(request)
155
+ rescue Net::HTTPRequestTimeout
156
+ raise Schematic::Errors::TimeoutError
157
+ end
158
+ code = response.code.to_i
159
+ if code.between?(200, 299)
160
+ Schematic::Plans::Types::CreateCustomPlanResponse.load(response.body)
161
+ else
162
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
163
+ raise error_class.new(response.body, code: code)
164
+ end
165
+ end
166
+
167
+ # @param request_options [Hash]
168
+ # @param params [Hash]
169
+ # @option request_options [String] :base_url
170
+ # @option request_options [Hash{String => Object}] :additional_headers
171
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
172
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
173
+ # @option request_options [Integer] :timeout_in_seconds
174
+ # @option params [String, nil] :company_id
175
+ # @option params [Boolean, nil] :company_scoped_only
176
+ # @option params [Boolean, nil] :exclude_company_scoped
58
177
  # @option params [Boolean, nil] :for_fallback_plan
59
178
  # @option params [Boolean, nil] :for_initial_plan
60
179
  # @option params [Boolean, nil] :for_trial_expiry_plan
@@ -63,6 +182,7 @@ module Schematic
63
182
  # @option params [Boolean, nil] :include_draft_versions
64
183
  # @option params [Schematic::Types::PlanType, nil] :plan_type
65
184
  # @option params [String, nil] :q
185
+ # @option params [String, nil] :scoped_to_company_id
66
186
  # @option params [String, nil] :without_entitlement_for
67
187
  # @option params [Boolean, nil] :without_paid_product_id
68
188
  # @option params [Integer, nil] :limit
@@ -71,9 +191,11 @@ module Schematic
71
191
  # @return [Schematic::Plans::Types::ListPlansResponse]
72
192
  def list_plans(request_options: {}, **params)
73
193
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
74
- query_param_names = %i[company_id for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q without_entitlement_for without_paid_product_id limit offset]
194
+ query_param_names = %i[company_id company_scoped_only exclude_company_scoped for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q scoped_to_company_id without_entitlement_for without_paid_product_id limit offset]
75
195
  query_params = {}
76
196
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
197
+ query_params["company_scoped_only"] = params[:company_scoped_only] if params.key?(:company_scoped_only)
198
+ query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
77
199
  query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
78
200
  query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
79
201
  query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
@@ -82,6 +204,7 @@ module Schematic
82
204
  query_params["include_draft_versions"] = params[:include_draft_versions] if params.key?(:include_draft_versions)
83
205
  query_params["plan_type"] = params[:plan_type] if params.key?(:plan_type)
84
206
  query_params["q"] = params[:q] if params.key?(:q)
207
+ query_params["scoped_to_company_id"] = params[:scoped_to_company_id] if params.key?(:scoped_to_company_id)
85
208
  query_params["without_entitlement_for"] = params[:without_entitlement_for] if params.key?(:without_entitlement_for)
86
209
  query_params["without_paid_product_id"] = params[:without_paid_product_id] if params.key?(:without_paid_product_id)
87
210
  query_params["limit"] = params[:limit] if params.key?(:limit)
@@ -278,6 +401,126 @@ module Schematic
278
401
  end
279
402
  end
280
403
 
404
+ # @param request_options [Hash]
405
+ # @param params [Schematic::Plans::Types::CreateBillingLinkedPlanRequestBody]
406
+ # @option request_options [String] :base_url
407
+ # @option request_options [Hash{String => Object}] :additional_headers
408
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
409
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
410
+ # @option request_options [Integer] :timeout_in_seconds
411
+ #
412
+ # @return [Schematic::Plans::Types::UpsertPlanForBillingProductResponse]
413
+ def upsert_plan_for_billing_product(request_options: {}, **params)
414
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
415
+ request = Schematic::Internal::JSON::Request.new(
416
+ base_url: request_options[:base_url],
417
+ method: "POST",
418
+ path: "plans/billing-linked",
419
+ body: Schematic::Plans::Types::CreateBillingLinkedPlanRequestBody.new(params).to_h,
420
+ request_options: request_options
421
+ )
422
+ begin
423
+ response = @client.send(request)
424
+ rescue Net::HTTPRequestTimeout
425
+ raise Schematic::Errors::TimeoutError
426
+ end
427
+ code = response.code.to_i
428
+ if code.between?(200, 299)
429
+ Schematic::Plans::Types::UpsertPlanForBillingProductResponse.load(response.body)
430
+ else
431
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
432
+ raise error_class.new(response.body, code: code)
433
+ end
434
+ end
435
+
436
+ # @param request_options [Hash]
437
+ # @param params [Hash]
438
+ # @option request_options [String] :base_url
439
+ # @option request_options [Hash{String => Object}] :additional_headers
440
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
441
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
442
+ # @option request_options [Integer] :timeout_in_seconds
443
+ # @option params [String] :plan_id
444
+ # @option params [String, nil] :q
445
+ # @option params [Integer, nil] :limit
446
+ # @option params [Integer, nil] :offset
447
+ #
448
+ # @return [Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse]
449
+ def list_billing_product_match_companies(request_options: {}, **params)
450
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
451
+ query_param_names = %i[plan_id q limit offset]
452
+ query_params = {}
453
+ query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
454
+ query_params["q"] = params[:q] if params.key?(:q)
455
+ query_params["limit"] = params[:limit] if params.key?(:limit)
456
+ query_params["offset"] = params[:offset] if params.key?(:offset)
457
+ params.except(*query_param_names)
458
+
459
+ request = Schematic::Internal::JSON::Request.new(
460
+ base_url: request_options[:base_url],
461
+ method: "GET",
462
+ path: "plans/billing-product-match-companies",
463
+ query: query_params,
464
+ request_options: request_options
465
+ )
466
+ begin
467
+ response = @client.send(request)
468
+ rescue Net::HTTPRequestTimeout
469
+ raise Schematic::Errors::TimeoutError
470
+ end
471
+ code = response.code.to_i
472
+ if code.between?(200, 299)
473
+ Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse.load(response.body)
474
+ else
475
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
476
+ raise error_class.new(response.body, code: code)
477
+ end
478
+ end
479
+
480
+ # @param request_options [Hash]
481
+ # @param params [Hash]
482
+ # @option request_options [String] :base_url
483
+ # @option request_options [Hash{String => Object}] :additional_headers
484
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
485
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
486
+ # @option request_options [Integer] :timeout_in_seconds
487
+ # @option params [String] :plan_id
488
+ # @option params [String, nil] :q
489
+ # @option params [Integer, nil] :limit
490
+ # @option params [Integer, nil] :offset
491
+ #
492
+ # @return [Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse]
493
+ def count_billing_product_match_companies(request_options: {}, **params)
494
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
495
+ query_param_names = %i[plan_id q limit offset]
496
+ query_params = {}
497
+ query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
498
+ query_params["q"] = params[:q] if params.key?(:q)
499
+ query_params["limit"] = params[:limit] if params.key?(:limit)
500
+ query_params["offset"] = params[:offset] if params.key?(:offset)
501
+ params.except(*query_param_names)
502
+
503
+ request = Schematic::Internal::JSON::Request.new(
504
+ base_url: request_options[:base_url],
505
+ method: "GET",
506
+ path: "plans/billing-product-match-companies/count",
507
+ query: query_params,
508
+ request_options: request_options
509
+ )
510
+ begin
511
+ response = @client.send(request)
512
+ rescue Net::HTTPRequestTimeout
513
+ raise Schematic::Errors::TimeoutError
514
+ end
515
+ code = response.code.to_i
516
+ if code.between?(200, 299)
517
+ Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse.load(response.body)
518
+ else
519
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
520
+ raise error_class.new(response.body, code: code)
521
+ end
522
+ end
523
+
281
524
  # @param request_options [Hash]
282
525
  # @param params [Hash]
283
526
  # @option request_options [String] :base_url
@@ -286,6 +529,8 @@ module Schematic
286
529
  # @option request_options [Hash{String => Object}] :additional_body_parameters
287
530
  # @option request_options [Integer] :timeout_in_seconds
288
531
  # @option params [String, nil] :company_id
532
+ # @option params [Boolean, nil] :company_scoped_only
533
+ # @option params [Boolean, nil] :exclude_company_scoped
289
534
  # @option params [Boolean, nil] :for_fallback_plan
290
535
  # @option params [Boolean, nil] :for_initial_plan
291
536
  # @option params [Boolean, nil] :for_trial_expiry_plan
@@ -294,6 +539,7 @@ module Schematic
294
539
  # @option params [Boolean, nil] :include_draft_versions
295
540
  # @option params [Schematic::Types::PlanType, nil] :plan_type
296
541
  # @option params [String, nil] :q
542
+ # @option params [String, nil] :scoped_to_company_id
297
543
  # @option params [String, nil] :without_entitlement_for
298
544
  # @option params [Boolean, nil] :without_paid_product_id
299
545
  # @option params [Integer, nil] :limit
@@ -302,9 +548,11 @@ module Schematic
302
548
  # @return [Schematic::Plans::Types::CountPlansResponse]
303
549
  def count_plans(request_options: {}, **params)
304
550
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
305
- query_param_names = %i[company_id for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q without_entitlement_for without_paid_product_id limit offset]
551
+ query_param_names = %i[company_id company_scoped_only exclude_company_scoped for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q scoped_to_company_id without_entitlement_for without_paid_product_id limit offset]
306
552
  query_params = {}
307
553
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
554
+ query_params["company_scoped_only"] = params[:company_scoped_only] if params.key?(:company_scoped_only)
555
+ query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
308
556
  query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
309
557
  query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
310
558
  query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
@@ -313,6 +561,7 @@ module Schematic
313
561
  query_params["include_draft_versions"] = params[:include_draft_versions] if params.key?(:include_draft_versions)
314
562
  query_params["plan_type"] = params[:plan_type] if params.key?(:plan_type)
315
563
  query_params["q"] = params[:q] if params.key?(:q)
564
+ query_params["scoped_to_company_id"] = params[:scoped_to_company_id] if params.key?(:scoped_to_company_id)
316
565
  query_params["without_entitlement_for"] = params[:without_entitlement_for] if params.key?(:without_entitlement_for)
317
566
  query_params["without_paid_product_id"] = params[:without_paid_product_id] if params.key?(:without_paid_product_id)
318
567
  query_params["limit"] = params[:limit] if params.key?(:limit)
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ # Input parameters
7
+ class CountBillingProductMatchCompaniesParams < Internal::Types::Model
8
+ field :limit, -> { Integer }, optional: true, nullable: false
9
+ field :offset, -> { Integer }, optional: true, nullable: false
10
+ field :plan_id, -> { String }, optional: true, nullable: false
11
+ field :q, -> { String }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class CountBillingProductMatchCompaniesRequest < Internal::Types::Model
7
+ field :plan_id, -> { String }, optional: false, nullable: false
8
+ field :q, -> { String }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class CountBillingProductMatchCompaniesResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CountResponse }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Plans::Types::CountBillingProductMatchCompaniesParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -6,6 +6,8 @@ module Schematic
6
6
  # Input parameters
7
7
  class CountPlansParams < Internal::Types::Model
8
8
  field :company_id, -> { String }, optional: true, nullable: false
9
+ field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
+ field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
9
11
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
12
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
11
13
  field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -16,6 +18,7 @@ module Schematic
16
18
  field :offset, -> { Integer }, optional: true, nullable: false
17
19
  field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
18
20
  field :q, -> { String }, optional: true, nullable: false
21
+ field :scoped_to_company_id, -> { String }, optional: true, nullable: false
19
22
  field :without_entitlement_for, -> { String }, optional: true, nullable: false
20
23
  field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
21
24
  end
@@ -5,6 +5,8 @@ module Schematic
5
5
  module Types
6
6
  class CountPlansRequest < Internal::Types::Model
7
7
  field :company_id, -> { String }, optional: true, nullable: false
8
+ field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
9
+ field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
8
10
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
9
11
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
12
  field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -13,6 +15,7 @@ module Schematic
13
15
  field :include_draft_versions, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
16
  field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
15
17
  field :q, -> { String }, optional: true, nullable: false
18
+ field :scoped_to_company_id, -> { String }, optional: true, nullable: false
16
19
  field :without_entitlement_for, -> { String }, optional: true, nullable: false
17
20
  field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
18
21
  field :limit, -> { Integer }, optional: true, nullable: false
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class CreateBillingLinkedPlanRequestBody < Internal::Types::Model
7
+ field :billing_provider, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
8
+ field :description, -> { String }, optional: false, nullable: false
9
+ field :external_resource_id, -> { String }, optional: false, nullable: false
10
+ field :external_resource_version, -> { String }, optional: true, nullable: false
11
+ field :icon, -> { Schematic::Types::PlanIcon }, optional: true, nullable: false
12
+ field :name, -> { String }, optional: false, nullable: false
13
+ field :plan_type, -> { Schematic::Types::PlanType }, optional: false, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class CreateCustomPlanRequestBody < Internal::Types::Model
7
+ field :company_id, -> { String }, optional: false, nullable: false
8
+ field :copied_from_plan_id, -> { String }, optional: true, nullable: false
9
+ field :description, -> { String }, optional: false, nullable: false
10
+ field :icon, -> { Schematic::Types::PlanIcon }, optional: true, nullable: false
11
+ field :name, -> { String }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Schematic
4
- module Companies
4
+ module Plans
5
5
  module Types
6
- class UpdatePlanTraitResponse < Internal::Types::Model
7
- field :data, -> { Schematic::Types::PlanTraitResponseData }, optional: false, nullable: false
6
+ class CreateCustomPlanResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::PlanDetailResponseData }, optional: false, nullable: false
8
8
  field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
9
  end
10
10
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ # Input parameters
7
+ class ListBillingProductMatchCompaniesParams < Internal::Types::Model
8
+ field :limit, -> { Integer }, optional: true, nullable: false
9
+ field :offset, -> { Integer }, optional: true, nullable: false
10
+ field :plan_id, -> { String }, optional: true, nullable: false
11
+ field :q, -> { String }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class ListBillingProductMatchCompaniesRequest < Internal::Types::Model
7
+ field :plan_id, -> { String }, optional: false, nullable: false
8
+ field :q, -> { String }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class ListBillingProductMatchCompaniesResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Schematic::Types::CompanyDetailResponseData] }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Plans::Types::ListBillingProductMatchCompaniesParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ # Input parameters
7
+ class ListCustomPlanBillingsParams < Internal::Types::Model
8
+ field :company_id, -> { String }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ field :plan_id, -> { String }, optional: true, nullable: false
12
+ field :status, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
13
+ field :statuses, -> { Internal::Types::Array[Schematic::Types::CustomPlanBillingStatus] }, optional: true, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class ListCustomPlanBillingsRequest < Internal::Types::Model
7
+ field :company_id, -> { String }, optional: true, nullable: false
8
+ field :plan_id, -> { String }, optional: true, nullable: false
9
+ field :status, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
10
+ field :statuses, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
11
+ field :limit, -> { Integer }, optional: true, nullable: false
12
+ field :offset, -> { Integer }, optional: true, nullable: false
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class ListCustomPlanBillingsResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Schematic::Types::CustomPlanBillingResponseData] }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Plans::Types::ListCustomPlanBillingsParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -6,6 +6,8 @@ module Schematic
6
6
  # Input parameters
7
7
  class ListPlansParams < Internal::Types::Model
8
8
  field :company_id, -> { String }, optional: true, nullable: false
9
+ field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
+ field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
9
11
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
12
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
11
13
  field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -16,6 +18,7 @@ module Schematic
16
18
  field :offset, -> { Integer }, optional: true, nullable: false
17
19
  field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
18
20
  field :q, -> { String }, optional: true, nullable: false
21
+ field :scoped_to_company_id, -> { String }, optional: true, nullable: false
19
22
  field :without_entitlement_for, -> { String }, optional: true, nullable: false
20
23
  field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
21
24
  end
@@ -5,6 +5,8 @@ module Schematic
5
5
  module Types
6
6
  class ListPlansRequest < Internal::Types::Model
7
7
  field :company_id, -> { String }, optional: true, nullable: false
8
+ field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
9
+ field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
8
10
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
9
11
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
10
12
  field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -13,6 +15,7 @@ module Schematic
13
15
  field :include_draft_versions, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
16
  field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
15
17
  field :q, -> { String }, optional: true, nullable: false
18
+ field :scoped_to_company_id, -> { String }, optional: true, nullable: false
16
19
  field :without_entitlement_for, -> { String }, optional: true, nullable: false
17
20
  field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
18
21
  field :limit, -> { Integer }, optional: true, nullable: false
@@ -5,8 +5,12 @@ module Schematic
5
5
  module Types
6
6
  class PublishPlanVersionRequestBody < Internal::Types::Model
7
7
  field :plan_id, -> { String }, optional: false, nullable: false
8
+ field :activation_strategy, -> { Schematic::Types::CustomPlanActivationStrategy }, optional: true, nullable: false
9
+ field :customer_email, -> { String }, optional: true, nullable: false
10
+ field :days_until_due, -> { Integer }, optional: true, nullable: false
8
11
  field :excluded_company_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
9
12
  field :migration_strategy, -> { Schematic::Types::PlanVersionMigrationStrategy }, optional: false, nullable: false
13
+ field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
10
14
  end
11
15
  end
12
16
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class RetryCustomPlanBillingRequestBody < Internal::Types::Model
7
+ field :custom_plan_billing_id, -> { String }, optional: false, nullable: false
8
+ field :activation_strategy, -> { Schematic::Types::CustomPlanActivationStrategy }, optional: true, nullable: false
9
+ field :customer_email, -> { String }, optional: false, nullable: false
10
+ field :days_until_due, -> { Integer }, optional: true, nullable: false
11
+ field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class RetryCustomPlanBillingResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CustomPlanBillingResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class UpsertPlanForBillingProductResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::PlanDetailResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -67,11 +67,14 @@ module Schematic
67
67
  @client.del(full_key)
68
68
  end
69
69
 
70
- def delete_missing(keys_to_keep)
70
+ # Scans `#{key_prefix}#{scope}*` only, so callers sharing a key_prefix
71
+ # across cache types (e.g. flags/company/user all under "schematic:") do
72
+ # not wipe sibling caches when pruning one of them.
73
+ def delete_missing(keys_to_keep, scope:)
71
74
  full_keys_to_keep = keys_to_keep.to_set { |k| prefixed_key(k) }
72
75
  keys_to_delete = []
73
76
 
74
- @client.scan_each(match: "#{@key_prefix}*", count: BATCH_DELETE_SIZE) do |key|
77
+ @client.scan_each(match: "#{@key_prefix}#{scope}*", count: BATCH_DELETE_SIZE) do |key|
75
78
  unless full_keys_to_keep.include?(key)
76
79
  keys_to_delete << key
77
80