schematichq 1.4.0

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 (848) hide show
  1. checksums.yaml +7 -0
  2. data/.claude/settings.json +16 -0
  3. data/.claude/skills/pr-review/SKILL.md +129 -0
  4. data/.fern/metadata.json +18 -0
  5. data/.fernignore +21 -0
  6. data/.rubocop.yml +69 -0
  7. data/CLAUDE.md +45 -0
  8. data/LICENSE +21 -0
  9. data/README.md +639 -0
  10. data/Rakefile +20 -0
  11. data/WASM_VERSION +1 -0
  12. data/custom.gemspec.rb +10 -0
  13. data/lib/schematic/accesstokens/client.rb +46 -0
  14. data/lib/schematic/accesstokens/types/issue_temporary_access_token_request_body.rb +12 -0
  15. data/lib/schematic/accesstokens/types/issue_temporary_access_token_response.rb +12 -0
  16. data/lib/schematic/accounts/client.rb +604 -0
  17. data/lib/schematic/accounts/types/count_api_keys_params.rb +15 -0
  18. data/lib/schematic/accounts/types/count_api_keys_request.rb +14 -0
  19. data/lib/schematic/accounts/types/count_api_keys_response.rb +12 -0
  20. data/lib/schematic/accounts/types/count_audit_logs_params.rb +18 -0
  21. data/lib/schematic/accounts/types/count_audit_logs_request.rb +17 -0
  22. data/lib/schematic/accounts/types/count_audit_logs_response.rb +12 -0
  23. data/lib/schematic/accounts/types/create_api_key_request_body.rb +14 -0
  24. data/lib/schematic/accounts/types/create_api_key_response.rb +12 -0
  25. data/lib/schematic/accounts/types/create_environment_request_body.rb +12 -0
  26. data/lib/schematic/accounts/types/create_environment_response.rb +12 -0
  27. data/lib/schematic/accounts/types/delete_api_key_response.rb +12 -0
  28. data/lib/schematic/accounts/types/delete_environment_response.rb +12 -0
  29. data/lib/schematic/accounts/types/get_api_key_response.rb +12 -0
  30. data/lib/schematic/accounts/types/get_audit_log_response.rb +12 -0
  31. data/lib/schematic/accounts/types/get_environment_response.rb +12 -0
  32. data/lib/schematic/accounts/types/get_who_am_i_response.rb +12 -0
  33. data/lib/schematic/accounts/types/list_api_keys_params.rb +15 -0
  34. data/lib/schematic/accounts/types/list_api_keys_request.rb +14 -0
  35. data/lib/schematic/accounts/types/list_api_keys_response.rb +12 -0
  36. data/lib/schematic/accounts/types/list_audit_logs_params.rb +18 -0
  37. data/lib/schematic/accounts/types/list_audit_logs_request.rb +17 -0
  38. data/lib/schematic/accounts/types/list_audit_logs_response.rb +12 -0
  39. data/lib/schematic/accounts/types/list_environments_params.rb +14 -0
  40. data/lib/schematic/accounts/types/list_environments_request.rb +13 -0
  41. data/lib/schematic/accounts/types/list_environments_response.rb +12 -0
  42. data/lib/schematic/accounts/types/quickstart_response.rb +12 -0
  43. data/lib/schematic/accounts/types/update_api_key_request_body.rb +13 -0
  44. data/lib/schematic/accounts/types/update_api_key_response.rb +12 -0
  45. data/lib/schematic/accounts/types/update_environment_request_body.rb +13 -0
  46. data/lib/schematic/accounts/types/update_environment_response.rb +12 -0
  47. data/lib/schematic/billing/client.rb +862 -0
  48. data/lib/schematic/billing/types/count_billing_products_params.rb +23 -0
  49. data/lib/schematic/billing/types/count_billing_products_request.rb +22 -0
  50. data/lib/schematic/billing/types/count_billing_products_response.rb +12 -0
  51. data/lib/schematic/billing/types/count_customers_params.rb +17 -0
  52. data/lib/schematic/billing/types/count_customers_request.rb +16 -0
  53. data/lib/schematic/billing/types/count_customers_response.rb +12 -0
  54. data/lib/schematic/billing/types/create_billing_customer_request_body.rb +17 -0
  55. data/lib/schematic/billing/types/create_billing_price_request_body.rb +25 -0
  56. data/lib/schematic/billing/types/create_billing_product_request_body.rb +15 -0
  57. data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +29 -0
  58. data/lib/schematic/billing/types/create_coupon_request_body.rb +19 -0
  59. data/lib/schematic/billing/types/create_invoice_request_body.rb +23 -0
  60. data/lib/schematic/billing/types/create_meter_request_body.rb +14 -0
  61. data/lib/schematic/billing/types/create_payment_method_request_body.rb +22 -0
  62. data/lib/schematic/billing/types/delete_billing_product_response.rb +12 -0
  63. data/lib/schematic/billing/types/delete_product_price_response.rb +12 -0
  64. data/lib/schematic/billing/types/list_billing_prices_params.rb +27 -0
  65. data/lib/schematic/billing/types/list_billing_prices_request.rb +26 -0
  66. data/lib/schematic/billing/types/list_billing_prices_response.rb +12 -0
  67. data/lib/schematic/billing/types/list_billing_product_prices_params.rb +27 -0
  68. data/lib/schematic/billing/types/list_billing_product_prices_request.rb +26 -0
  69. data/lib/schematic/billing/types/list_billing_product_prices_response.rb +12 -0
  70. data/lib/schematic/billing/types/list_billing_products_params.rb +23 -0
  71. data/lib/schematic/billing/types/list_billing_products_request.rb +22 -0
  72. data/lib/schematic/billing/types/list_billing_products_response.rb +12 -0
  73. data/lib/schematic/billing/types/list_coupons_params.rb +15 -0
  74. data/lib/schematic/billing/types/list_coupons_request.rb +14 -0
  75. data/lib/schematic/billing/types/list_coupons_response.rb +12 -0
  76. data/lib/schematic/billing/types/list_customers_with_subscriptions_params.rb +17 -0
  77. data/lib/schematic/billing/types/list_customers_with_subscriptions_request.rb +16 -0
  78. data/lib/schematic/billing/types/list_customers_with_subscriptions_response.rb +12 -0
  79. data/lib/schematic/billing/types/list_invoices_params.rb +16 -0
  80. data/lib/schematic/billing/types/list_invoices_request.rb +15 -0
  81. data/lib/schematic/billing/types/list_invoices_response.rb +12 -0
  82. data/lib/schematic/billing/types/list_meters_params.rb +14 -0
  83. data/lib/schematic/billing/types/list_meters_request.rb +13 -0
  84. data/lib/schematic/billing/types/list_meters_response.rb +12 -0
  85. data/lib/schematic/billing/types/list_payment_methods_params.rb +15 -0
  86. data/lib/schematic/billing/types/list_payment_methods_request.rb +14 -0
  87. data/lib/schematic/billing/types/list_payment_methods_response.rb +12 -0
  88. data/lib/schematic/billing/types/upsert_billing_coupon_response.rb +12 -0
  89. data/lib/schematic/billing/types/upsert_billing_customer_response.rb +12 -0
  90. data/lib/schematic/billing/types/upsert_billing_meter_response.rb +12 -0
  91. data/lib/schematic/billing/types/upsert_billing_price_response.rb +12 -0
  92. data/lib/schematic/billing/types/upsert_billing_product_response.rb +12 -0
  93. data/lib/schematic/billing/types/upsert_billing_subscription_response.rb +12 -0
  94. data/lib/schematic/billing/types/upsert_invoice_response.rb +12 -0
  95. data/lib/schematic/billing/types/upsert_payment_method_response.rb +12 -0
  96. data/lib/schematic/cache.rb +133 -0
  97. data/lib/schematic/checkout/client.rb +243 -0
  98. data/lib/schematic/checkout/types/cancel_subscription_request.rb +13 -0
  99. data/lib/schematic/checkout/types/cancel_subscription_response.rb +12 -0
  100. data/lib/schematic/checkout/types/checkout_data_request_body.rb +12 -0
  101. data/lib/schematic/checkout/types/checkout_internal_response.rb +12 -0
  102. data/lib/schematic/checkout/types/get_checkout_data_response.rb +12 -0
  103. data/lib/schematic/checkout/types/manage_plan_response.rb +12 -0
  104. data/lib/schematic/checkout/types/preview_checkout_internal_response.rb +12 -0
  105. data/lib/schematic/checkout/types/preview_manage_plan_response.rb +12 -0
  106. data/lib/schematic/checkout/types/update_customer_subscription_trial_end_response.rb +12 -0
  107. data/lib/schematic/checkout/types/update_trial_end_request_body.rb +12 -0
  108. data/lib/schematic/client.rb +110 -0
  109. data/lib/schematic/companies/client.rb +1561 -0
  110. data/lib/schematic/companies/types/count_companies_params.rb +29 -0
  111. data/lib/schematic/companies/types/count_companies_request.rb +28 -0
  112. data/lib/schematic/companies/types/count_companies_response.rb +12 -0
  113. data/lib/schematic/companies/types/count_entity_key_definitions_params.rb +16 -0
  114. data/lib/schematic/companies/types/count_entity_key_definitions_request.rb +15 -0
  115. data/lib/schematic/companies/types/count_entity_key_definitions_response.rb +12 -0
  116. data/lib/schematic/companies/types/count_entity_trait_definitions_params.rb +18 -0
  117. data/lib/schematic/companies/types/count_entity_trait_definitions_request.rb +17 -0
  118. data/lib/schematic/companies/types/count_entity_trait_definitions_response.rb +12 -0
  119. data/lib/schematic/companies/types/count_plan_traits_params.rb +17 -0
  120. data/lib/schematic/companies/types/count_plan_traits_request.rb +16 -0
  121. data/lib/schematic/companies/types/count_plan_traits_response.rb +12 -0
  122. data/lib/schematic/companies/types/count_users_params.rb +17 -0
  123. data/lib/schematic/companies/types/count_users_request.rb +16 -0
  124. data/lib/schematic/companies/types/count_users_response.rb +12 -0
  125. data/lib/schematic/companies/types/create_company_response.rb +12 -0
  126. data/lib/schematic/companies/types/create_entity_trait_definition_request_body.rb +14 -0
  127. data/lib/schematic/companies/types/create_plan_trait_request_body.rb +13 -0
  128. data/lib/schematic/companies/types/create_plan_trait_response.rb +12 -0
  129. data/lib/schematic/companies/types/create_user_response.rb +12 -0
  130. data/lib/schematic/companies/types/delete_company_by_keys_response.rb +12 -0
  131. data/lib/schematic/companies/types/delete_company_membership_response.rb +12 -0
  132. data/lib/schematic/companies/types/delete_company_params.rb +13 -0
  133. data/lib/schematic/companies/types/delete_company_request.rb +13 -0
  134. data/lib/schematic/companies/types/delete_company_response.rb +12 -0
  135. data/lib/schematic/companies/types/delete_plan_trait_response.rb +12 -0
  136. data/lib/schematic/companies/types/delete_user_by_keys_response.rb +12 -0
  137. data/lib/schematic/companies/types/delete_user_response.rb +12 -0
  138. data/lib/schematic/companies/types/get_active_company_subscription_params.rb +15 -0
  139. data/lib/schematic/companies/types/get_active_company_subscription_request.rb +14 -0
  140. data/lib/schematic/companies/types/get_active_company_subscription_response.rb +12 -0
  141. data/lib/schematic/companies/types/get_company_response.rb +12 -0
  142. data/lib/schematic/companies/types/get_entity_trait_definition_response.rb +12 -0
  143. data/lib/schematic/companies/types/get_entity_trait_values_params.rb +15 -0
  144. data/lib/schematic/companies/types/get_entity_trait_values_request.rb +14 -0
  145. data/lib/schematic/companies/types/get_entity_trait_values_response.rb +12 -0
  146. data/lib/schematic/companies/types/get_or_create_company_membership_request_body.rb +12 -0
  147. data/lib/schematic/companies/types/get_or_create_company_membership_response.rb +12 -0
  148. data/lib/schematic/companies/types/get_or_create_entity_trait_definition_response.rb +12 -0
  149. data/lib/schematic/companies/types/get_plan_change_response.rb +12 -0
  150. data/lib/schematic/companies/types/get_plan_trait_response.rb +12 -0
  151. data/lib/schematic/companies/types/get_user_response.rb +12 -0
  152. data/lib/schematic/companies/types/list_companies_params.rb +29 -0
  153. data/lib/schematic/companies/types/list_companies_request.rb +28 -0
  154. data/lib/schematic/companies/types/list_companies_response.rb +12 -0
  155. data/lib/schematic/companies/types/list_company_memberships_params.rb +15 -0
  156. data/lib/schematic/companies/types/list_company_memberships_request.rb +14 -0
  157. data/lib/schematic/companies/types/list_company_memberships_response.rb +12 -0
  158. data/lib/schematic/companies/types/list_entity_key_definitions_params.rb +16 -0
  159. data/lib/schematic/companies/types/list_entity_key_definitions_request.rb +15 -0
  160. data/lib/schematic/companies/types/list_entity_key_definitions_response.rb +12 -0
  161. data/lib/schematic/companies/types/list_entity_trait_definitions_params.rb +18 -0
  162. data/lib/schematic/companies/types/list_entity_trait_definitions_request.rb +17 -0
  163. data/lib/schematic/companies/types/list_entity_trait_definitions_response.rb +12 -0
  164. data/lib/schematic/companies/types/list_plan_changes_params.rb +18 -0
  165. data/lib/schematic/companies/types/list_plan_changes_request.rb +17 -0
  166. data/lib/schematic/companies/types/list_plan_changes_response.rb +12 -0
  167. data/lib/schematic/companies/types/list_plan_traits_params.rb +17 -0
  168. data/lib/schematic/companies/types/list_plan_traits_request.rb +16 -0
  169. data/lib/schematic/companies/types/list_plan_traits_response.rb +12 -0
  170. data/lib/schematic/companies/types/list_users_params.rb +17 -0
  171. data/lib/schematic/companies/types/list_users_request.rb +16 -0
  172. data/lib/schematic/companies/types/list_users_response.rb +12 -0
  173. data/lib/schematic/companies/types/lookup_company_params.rb +12 -0
  174. data/lib/schematic/companies/types/lookup_company_request.rb +11 -0
  175. data/lib/schematic/companies/types/lookup_company_response.rb +12 -0
  176. data/lib/schematic/companies/types/lookup_user_params.rb +12 -0
  177. data/lib/schematic/companies/types/lookup_user_request.rb +11 -0
  178. data/lib/schematic/companies/types/lookup_user_response.rb +12 -0
  179. data/lib/schematic/companies/types/update_entity_trait_definition_request_body.rb +13 -0
  180. data/lib/schematic/companies/types/update_entity_trait_definition_response.rb +12 -0
  181. data/lib/schematic/companies/types/update_plan_trait_bulk_request_body.rb +13 -0
  182. data/lib/schematic/companies/types/update_plan_trait_request_body.rb +13 -0
  183. data/lib/schematic/companies/types/update_plan_trait_response.rb +12 -0
  184. data/lib/schematic/companies/types/update_plan_traits_bulk_response.rb +12 -0
  185. data/lib/schematic/companies/types/upsert_company_response.rb +12 -0
  186. data/lib/schematic/companies/types/upsert_company_trait_response.rb +12 -0
  187. data/lib/schematic/companies/types/upsert_user_response.rb +12 -0
  188. data/lib/schematic/companies/types/upsert_user_trait_response.rb +12 -0
  189. data/lib/schematic/components/client.rb +271 -0
  190. data/lib/schematic/components/types/count_components_params.rb +14 -0
  191. data/lib/schematic/components/types/count_components_request.rb +13 -0
  192. data/lib/schematic/components/types/count_components_response.rb +12 -0
  193. data/lib/schematic/components/types/create_component_request_body.rb +13 -0
  194. data/lib/schematic/components/types/create_component_response.rb +12 -0
  195. data/lib/schematic/components/types/delete_component_response.rb +12 -0
  196. data/lib/schematic/components/types/get_component_response.rb +12 -0
  197. data/lib/schematic/components/types/list_components_params.rb +14 -0
  198. data/lib/schematic/components/types/list_components_request.rb +13 -0
  199. data/lib/schematic/components/types/list_components_response.rb +12 -0
  200. data/lib/schematic/components/types/preview_component_data_params.rb +13 -0
  201. data/lib/schematic/components/types/preview_component_data_request.rb +12 -0
  202. data/lib/schematic/components/types/preview_component_data_response.rb +12 -0
  203. data/lib/schematic/components/types/update_component_request_body.rb +15 -0
  204. data/lib/schematic/components/types/update_component_response.rb +12 -0
  205. data/lib/schematic/componentspublic/client.rb +45 -0
  206. data/lib/schematic/componentspublic/types/get_public_plans_response.rb +12 -0
  207. data/lib/schematic/credits/client.rb +1157 -0
  208. data/lib/schematic/credits/types/count_billing_credits_grants_params.rb +15 -0
  209. data/lib/schematic/credits/types/count_billing_credits_grants_request.rb +14 -0
  210. data/lib/schematic/credits/types/count_billing_credits_grants_response.rb +12 -0
  211. data/lib/schematic/credits/types/count_billing_credits_params.rb +15 -0
  212. data/lib/schematic/credits/types/count_billing_credits_request.rb +14 -0
  213. data/lib/schematic/credits/types/count_billing_credits_response.rb +12 -0
  214. data/lib/schematic/credits/types/count_billing_plan_credit_grants_params.rb +18 -0
  215. data/lib/schematic/credits/types/count_billing_plan_credit_grants_request.rb +17 -0
  216. data/lib/schematic/credits/types/count_billing_plan_credit_grants_response.rb +12 -0
  217. data/lib/schematic/credits/types/count_company_grants_params.rb +16 -0
  218. data/lib/schematic/credits/types/count_company_grants_request.rb +15 -0
  219. data/lib/schematic/credits/types/count_company_grants_response.rb +12 -0
  220. data/lib/schematic/credits/types/count_credit_bundles_params.rb +17 -0
  221. data/lib/schematic/credits/types/count_credit_bundles_request.rb +16 -0
  222. data/lib/schematic/credits/types/count_credit_bundles_response.rb +12 -0
  223. data/lib/schematic/credits/types/count_credit_event_ledger_params.rb +19 -0
  224. data/lib/schematic/credits/types/count_credit_event_ledger_request.rb +18 -0
  225. data/lib/schematic/credits/types/count_credit_event_ledger_response.rb +12 -0
  226. data/lib/schematic/credits/types/count_credit_ledger_params.rb +19 -0
  227. data/lib/schematic/credits/types/count_credit_ledger_request.rb +18 -0
  228. data/lib/schematic/credits/types/count_credit_ledger_response.rb +12 -0
  229. data/lib/schematic/credits/types/create_billing_credit_request_body.rb +23 -0
  230. data/lib/schematic/credits/types/create_billing_credit_response.rb +12 -0
  231. data/lib/schematic/credits/types/create_billing_plan_credit_grant_response.rb +12 -0
  232. data/lib/schematic/credits/types/create_company_credit_grant.rb +22 -0
  233. data/lib/schematic/credits/types/create_credit_bundle_request_body.rb +22 -0
  234. data/lib/schematic/credits/types/create_credit_bundle_response.rb +12 -0
  235. data/lib/schematic/credits/types/delete_billing_plan_credit_grant_params.rb +12 -0
  236. data/lib/schematic/credits/types/delete_billing_plan_credit_grant_request.rb +12 -0
  237. data/lib/schematic/credits/types/delete_billing_plan_credit_grant_response.rb +12 -0
  238. data/lib/schematic/credits/types/delete_credit_bundle_response.rb +12 -0
  239. data/lib/schematic/credits/types/get_credit_bundle_response.rb +12 -0
  240. data/lib/schematic/credits/types/get_enriched_credit_ledger_params.rb +19 -0
  241. data/lib/schematic/credits/types/get_enriched_credit_ledger_request.rb +18 -0
  242. data/lib/schematic/credits/types/get_enriched_credit_ledger_response.rb +12 -0
  243. data/lib/schematic/credits/types/get_single_billing_credit_response.rb +12 -0
  244. data/lib/schematic/credits/types/get_single_billing_plan_credit_grant_response.rb +12 -0
  245. data/lib/schematic/credits/types/grant_billing_credits_to_company_response.rb +12 -0
  246. data/lib/schematic/credits/types/list_billing_credits_params.rb +15 -0
  247. data/lib/schematic/credits/types/list_billing_credits_request.rb +14 -0
  248. data/lib/schematic/credits/types/list_billing_credits_response.rb +12 -0
  249. data/lib/schematic/credits/types/list_billing_plan_credit_grants_params.rb +18 -0
  250. data/lib/schematic/credits/types/list_billing_plan_credit_grants_request.rb +17 -0
  251. data/lib/schematic/credits/types/list_billing_plan_credit_grants_response.rb +12 -0
  252. data/lib/schematic/credits/types/list_company_grants_params.rb +16 -0
  253. data/lib/schematic/credits/types/list_company_grants_request.rb +15 -0
  254. data/lib/schematic/credits/types/list_company_grants_response.rb +12 -0
  255. data/lib/schematic/credits/types/list_credit_bundles_params.rb +17 -0
  256. data/lib/schematic/credits/types/list_credit_bundles_request.rb +16 -0
  257. data/lib/schematic/credits/types/list_credit_bundles_response.rb +12 -0
  258. data/lib/schematic/credits/types/list_credit_event_ledger_params.rb +19 -0
  259. data/lib/schematic/credits/types/list_credit_event_ledger_request.rb +18 -0
  260. data/lib/schematic/credits/types/list_credit_event_ledger_response.rb +12 -0
  261. data/lib/schematic/credits/types/list_grants_for_credit_params.rb +15 -0
  262. data/lib/schematic/credits/types/list_grants_for_credit_request.rb +14 -0
  263. data/lib/schematic/credits/types/list_grants_for_credit_response.rb +12 -0
  264. data/lib/schematic/credits/types/soft_delete_billing_credit_response.rb +12 -0
  265. data/lib/schematic/credits/types/update_billing_credit_request_body.rb +23 -0
  266. data/lib/schematic/credits/types/update_billing_credit_response.rb +12 -0
  267. data/lib/schematic/credits/types/update_billing_plan_credit_grant_response.rb +12 -0
  268. data/lib/schematic/credits/types/update_credit_bundle_details_request_body.rb +20 -0
  269. data/lib/schematic/credits/types/update_credit_bundle_details_response.rb +12 -0
  270. data/lib/schematic/credits/types/zero_out_grant_request_body.rb +12 -0
  271. data/lib/schematic/credits/types/zero_out_grant_response.rb +12 -0
  272. data/lib/schematic/dataexports/client.rb +76 -0
  273. data/lib/schematic/dataexports/types/create_data_export_request_body.rb +13 -0
  274. data/lib/schematic/dataexports/types/create_data_export_response.rb +12 -0
  275. data/lib/schematic/datastream/client.rb +508 -0
  276. data/lib/schematic/datastream/merge.rb +95 -0
  277. data/lib/schematic/datastream/resource_cache.rb +76 -0
  278. data/lib/schematic/datastream/websocket_client.rb +315 -0
  279. data/lib/schematic/entitlements/client.rb +900 -0
  280. data/lib/schematic/entitlements/types/count_company_overrides_params.rb +20 -0
  281. data/lib/schematic/entitlements/types/count_company_overrides_request.rb +19 -0
  282. data/lib/schematic/entitlements/types/count_company_overrides_response.rb +12 -0
  283. data/lib/schematic/entitlements/types/count_feature_companies_params.rb +15 -0
  284. data/lib/schematic/entitlements/types/count_feature_companies_request.rb +14 -0
  285. data/lib/schematic/entitlements/types/count_feature_companies_response.rb +12 -0
  286. data/lib/schematic/entitlements/types/count_feature_usage_params.rb +19 -0
  287. data/lib/schematic/entitlements/types/count_feature_usage_request.rb +18 -0
  288. data/lib/schematic/entitlements/types/count_feature_usage_response.rb +12 -0
  289. data/lib/schematic/entitlements/types/count_feature_users_params.rb +15 -0
  290. data/lib/schematic/entitlements/types/count_feature_users_request.rb +14 -0
  291. data/lib/schematic/entitlements/types/count_feature_users_response.rb +12 -0
  292. data/lib/schematic/entitlements/types/count_plan_entitlements_params.rb +22 -0
  293. data/lib/schematic/entitlements/types/count_plan_entitlements_request.rb +21 -0
  294. data/lib/schematic/entitlements/types/count_plan_entitlements_response.rb +12 -0
  295. data/lib/schematic/entitlements/types/create_company_override_request_body.rb +22 -0
  296. data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period.rb +16 -0
  297. data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period_month_reset.rb +14 -0
  298. data/lib/schematic/entitlements/types/create_company_override_response.rb +12 -0
  299. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +38 -0
  300. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.rb +16 -0
  301. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period_month_reset.rb +14 -0
  302. data/lib/schematic/entitlements/types/create_plan_entitlement_response.rb +12 -0
  303. data/lib/schematic/entitlements/types/delete_company_override_response.rb +12 -0
  304. data/lib/schematic/entitlements/types/delete_plan_entitlement_response.rb +12 -0
  305. data/lib/schematic/entitlements/types/duplicate_plan_entitlements_request_body.rb +12 -0
  306. data/lib/schematic/entitlements/types/duplicate_plan_entitlements_response.rb +12 -0
  307. data/lib/schematic/entitlements/types/get_company_override_response.rb +12 -0
  308. data/lib/schematic/entitlements/types/get_feature_usage_by_company_params.rb +12 -0
  309. data/lib/schematic/entitlements/types/get_feature_usage_by_company_request.rb +11 -0
  310. data/lib/schematic/entitlements/types/get_feature_usage_by_company_response.rb +12 -0
  311. data/lib/schematic/entitlements/types/get_feature_usage_time_series_params.rb +16 -0
  312. data/lib/schematic/entitlements/types/get_feature_usage_time_series_request.rb +15 -0
  313. data/lib/schematic/entitlements/types/get_feature_usage_time_series_response.rb +12 -0
  314. data/lib/schematic/entitlements/types/get_plan_entitlement_response.rb +12 -0
  315. data/lib/schematic/entitlements/types/list_company_overrides_params.rb +20 -0
  316. data/lib/schematic/entitlements/types/list_company_overrides_request.rb +19 -0
  317. data/lib/schematic/entitlements/types/list_company_overrides_response.rb +12 -0
  318. data/lib/schematic/entitlements/types/list_feature_companies_params.rb +15 -0
  319. data/lib/schematic/entitlements/types/list_feature_companies_request.rb +14 -0
  320. data/lib/schematic/entitlements/types/list_feature_companies_response.rb +12 -0
  321. data/lib/schematic/entitlements/types/list_feature_usage_params.rb +19 -0
  322. data/lib/schematic/entitlements/types/list_feature_usage_request.rb +18 -0
  323. data/lib/schematic/entitlements/types/list_feature_usage_response.rb +12 -0
  324. data/lib/schematic/entitlements/types/list_feature_users_params.rb +15 -0
  325. data/lib/schematic/entitlements/types/list_feature_users_request.rb +14 -0
  326. data/lib/schematic/entitlements/types/list_feature_users_response.rb +12 -0
  327. data/lib/schematic/entitlements/types/list_plan_entitlements_params.rb +22 -0
  328. data/lib/schematic/entitlements/types/list_plan_entitlements_request.rb +21 -0
  329. data/lib/schematic/entitlements/types/list_plan_entitlements_response.rb +12 -0
  330. data/lib/schematic/entitlements/types/update_company_override_request_body.rb +21 -0
  331. data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period.rb +16 -0
  332. data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period_month_reset.rb +14 -0
  333. data/lib/schematic/entitlements/types/update_company_override_response.rb +12 -0
  334. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +36 -0
  335. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.rb +16 -0
  336. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period_month_reset.rb +14 -0
  337. data/lib/schematic/entitlements/types/update_plan_entitlement_response.rb +12 -0
  338. data/lib/schematic/environment.rb +7 -0
  339. data/lib/schematic/errors/api_error.rb +8 -0
  340. data/lib/schematic/errors/client_error.rb +17 -0
  341. data/lib/schematic/errors/redirect_error.rb +8 -0
  342. data/lib/schematic/errors/response_error.rb +42 -0
  343. data/lib/schematic/errors/server_error.rb +11 -0
  344. data/lib/schematic/errors/timeout_error.rb +8 -0
  345. data/lib/schematic/event_buffer.rb +180 -0
  346. data/lib/schematic/events/client.rb +235 -0
  347. data/lib/schematic/events/types/create_event_batch_request_body.rb +11 -0
  348. data/lib/schematic/events/types/create_event_batch_response.rb +12 -0
  349. data/lib/schematic/events/types/create_event_response.rb +12 -0
  350. data/lib/schematic/events/types/get_event_response.rb +12 -0
  351. data/lib/schematic/events/types/get_event_summaries_params.rb +15 -0
  352. data/lib/schematic/events/types/get_event_summaries_request.rb +14 -0
  353. data/lib/schematic/events/types/get_event_summaries_response.rb +12 -0
  354. data/lib/schematic/events/types/get_segment_integration_status_response.rb +12 -0
  355. data/lib/schematic/events/types/list_events_params.rb +18 -0
  356. data/lib/schematic/events/types/list_events_request.rb +17 -0
  357. data/lib/schematic/events/types/list_events_response.rb +12 -0
  358. data/lib/schematic/features/client.rb +610 -0
  359. data/lib/schematic/features/types/check_flag_response.rb +12 -0
  360. data/lib/schematic/features/types/check_flags_bulk_request_body.rb +11 -0
  361. data/lib/schematic/features/types/check_flags_bulk_response.rb +12 -0
  362. data/lib/schematic/features/types/check_flags_response.rb +12 -0
  363. data/lib/schematic/features/types/count_features_params.rb +20 -0
  364. data/lib/schematic/features/types/count_features_request.rb +19 -0
  365. data/lib/schematic/features/types/count_features_response.rb +12 -0
  366. data/lib/schematic/features/types/count_flags_params.rb +16 -0
  367. data/lib/schematic/features/types/count_flags_request.rb +15 -0
  368. data/lib/schematic/features/types/count_flags_response.rb +12 -0
  369. data/lib/schematic/features/types/create_feature_request_body.rb +21 -0
  370. data/lib/schematic/features/types/create_feature_response.rb +12 -0
  371. data/lib/schematic/features/types/create_flag_response.rb +12 -0
  372. data/lib/schematic/features/types/delete_feature_response.rb +12 -0
  373. data/lib/schematic/features/types/delete_flag_response.rb +12 -0
  374. data/lib/schematic/features/types/get_feature_response.rb +12 -0
  375. data/lib/schematic/features/types/get_flag_response.rb +12 -0
  376. data/lib/schematic/features/types/list_features_params.rb +20 -0
  377. data/lib/schematic/features/types/list_features_request.rb +19 -0
  378. data/lib/schematic/features/types/list_features_response.rb +12 -0
  379. data/lib/schematic/features/types/list_flags_params.rb +16 -0
  380. data/lib/schematic/features/types/list_flags_request.rb +15 -0
  381. data/lib/schematic/features/types/list_flags_response.rb +12 -0
  382. data/lib/schematic/features/types/update_feature_request_body.rb +22 -0
  383. data/lib/schematic/features/types/update_feature_response.rb +12 -0
  384. data/lib/schematic/features/types/update_flag_response.rb +12 -0
  385. data/lib/schematic/features/types/update_flag_rules_request_body.rb +12 -0
  386. data/lib/schematic/features/types/update_flag_rules_response.rb +12 -0
  387. data/lib/schematic/internal/errors/constraint_error.rb +10 -0
  388. data/lib/schematic/internal/errors/type_error.rb +10 -0
  389. data/lib/schematic/internal/http/base_request.rb +51 -0
  390. data/lib/schematic/internal/http/raw_client.rb +214 -0
  391. data/lib/schematic/internal/iterators/cursor_item_iterator.rb +28 -0
  392. data/lib/schematic/internal/iterators/cursor_page_iterator.rb +51 -0
  393. data/lib/schematic/internal/iterators/item_iterator.rb +59 -0
  394. data/lib/schematic/internal/iterators/offset_item_iterator.rb +30 -0
  395. data/lib/schematic/internal/iterators/offset_page_iterator.rb +83 -0
  396. data/lib/schematic/internal/json/request.rb +41 -0
  397. data/lib/schematic/internal/json/serializable.rb +25 -0
  398. data/lib/schematic/internal/multipart/multipart_encoder.rb +141 -0
  399. data/lib/schematic/internal/multipart/multipart_form_data.rb +78 -0
  400. data/lib/schematic/internal/multipart/multipart_form_data_part.rb +51 -0
  401. data/lib/schematic/internal/multipart/multipart_request.rb +40 -0
  402. data/lib/schematic/internal/types/array.rb +47 -0
  403. data/lib/schematic/internal/types/boolean.rb +34 -0
  404. data/lib/schematic/internal/types/enum.rb +56 -0
  405. data/lib/schematic/internal/types/hash.rb +36 -0
  406. data/lib/schematic/internal/types/model/field.rb +38 -0
  407. data/lib/schematic/internal/types/model.rb +208 -0
  408. data/lib/schematic/internal/types/type.rb +35 -0
  409. data/lib/schematic/internal/types/union.rb +161 -0
  410. data/lib/schematic/internal/types/unknown.rb +15 -0
  411. data/lib/schematic/internal/types/utils.rb +116 -0
  412. data/lib/schematic/logger.rb +62 -0
  413. data/lib/schematic/planbundle/client.rb +83 -0
  414. data/lib/schematic/planbundle/types/create_plan_bundle_request_body.rb +15 -0
  415. data/lib/schematic/planbundle/types/create_plan_bundle_response.rb +12 -0
  416. data/lib/schematic/planbundle/types/update_plan_bundle_request_body.rb +17 -0
  417. data/lib/schematic/planbundle/types/update_plan_bundle_response.rb +12 -0
  418. data/lib/schematic/plangroups/client.rb +121 -0
  419. data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +42 -0
  420. data/lib/schematic/plangroups/types/create_plan_group_response.rb +12 -0
  421. data/lib/schematic/plangroups/types/get_plan_group_params.rb +12 -0
  422. data/lib/schematic/plangroups/types/get_plan_group_request.rb +11 -0
  423. data/lib/schematic/plangroups/types/get_plan_group_response.rb +12 -0
  424. data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +43 -0
  425. data/lib/schematic/plangroups/types/update_plan_group_response.rb +12 -0
  426. data/lib/schematic/planmigrations/client.rb +226 -0
  427. data/lib/schematic/planmigrations/types/count_company_migrations_params.rb +16 -0
  428. data/lib/schematic/planmigrations/types/count_company_migrations_request.rb +15 -0
  429. data/lib/schematic/planmigrations/types/count_company_migrations_response.rb +12 -0
  430. data/lib/schematic/planmigrations/types/count_migrations_params.rb +15 -0
  431. data/lib/schematic/planmigrations/types/count_migrations_request.rb +14 -0
  432. data/lib/schematic/planmigrations/types/count_migrations_response.rb +12 -0
  433. data/lib/schematic/planmigrations/types/get_migration_response.rb +12 -0
  434. data/lib/schematic/planmigrations/types/list_company_migrations_params.rb +16 -0
  435. data/lib/schematic/planmigrations/types/list_company_migrations_request.rb +15 -0
  436. data/lib/schematic/planmigrations/types/list_company_migrations_response.rb +12 -0
  437. data/lib/schematic/planmigrations/types/list_migrations_params.rb +15 -0
  438. data/lib/schematic/planmigrations/types/list_migrations_request.rb +14 -0
  439. data/lib/schematic/planmigrations/types/list_migrations_response.rb +12 -0
  440. data/lib/schematic/plans/client.rb +460 -0
  441. data/lib/schematic/plans/types/count_plans_params.rb +24 -0
  442. data/lib/schematic/plans/types/count_plans_request.rb +23 -0
  443. data/lib/schematic/plans/types/count_plans_response.rb +12 -0
  444. data/lib/schematic/plans/types/create_plan_response.rb +12 -0
  445. data/lib/schematic/plans/types/delete_plan_response.rb +12 -0
  446. data/lib/schematic/plans/types/delete_plan_version_params.rb +12 -0
  447. data/lib/schematic/plans/types/delete_plan_version_request.rb +12 -0
  448. data/lib/schematic/plans/types/delete_plan_version_response.rb +12 -0
  449. data/lib/schematic/plans/types/get_plan_params.rb +12 -0
  450. data/lib/schematic/plans/types/get_plan_request.rb +12 -0
  451. data/lib/schematic/plans/types/get_plan_response.rb +12 -0
  452. data/lib/schematic/plans/types/list_plan_issues_params.rb +13 -0
  453. data/lib/schematic/plans/types/list_plan_issues_request.rb +12 -0
  454. data/lib/schematic/plans/types/list_plan_issues_response.rb +12 -0
  455. data/lib/schematic/plans/types/list_plans_params.rb +24 -0
  456. data/lib/schematic/plans/types/list_plans_request.rb +23 -0
  457. data/lib/schematic/plans/types/list_plans_response.rb +12 -0
  458. data/lib/schematic/plans/types/publish_plan_version_request_body.rb +13 -0
  459. data/lib/schematic/plans/types/publish_plan_version_response.rb +12 -0
  460. data/lib/schematic/plans/types/update_company_plans_request_body.rb +13 -0
  461. data/lib/schematic/plans/types/update_company_plans_response.rb +12 -0
  462. data/lib/schematic/plans/types/update_plan_response.rb +12 -0
  463. data/lib/schematic/plans/types/upsert_billing_product_plan_response.rb +12 -0
  464. data/lib/schematic/redis_cache.rb +94 -0
  465. data/lib/schematic/rules_engine.rb +145 -0
  466. data/lib/schematic/scheduledcheckout/client.rb +159 -0
  467. data/lib/schematic/scheduledcheckout/types/create_scheduled_checkout_request.rb +14 -0
  468. data/lib/schematic/scheduledcheckout/types/create_scheduled_checkout_response.rb +12 -0
  469. data/lib/schematic/scheduledcheckout/types/get_scheduled_checkout_response.rb +12 -0
  470. data/lib/schematic/scheduledcheckout/types/list_scheduled_checkouts_params.rb +15 -0
  471. data/lib/schematic/scheduledcheckout/types/list_scheduled_checkouts_request.rb +14 -0
  472. data/lib/schematic/scheduledcheckout/types/list_scheduled_checkouts_response.rb +12 -0
  473. data/lib/schematic/scheduledcheckout/types/update_scheduled_checkout_request.rb +13 -0
  474. data/lib/schematic/scheduledcheckout/types/update_scheduled_checkout_response.rb +12 -0
  475. data/lib/schematic/schematic_client.rb +552 -0
  476. data/lib/schematic/types/actor_type.rb +15 -0
  477. data/lib/schematic/types/api_error.rb +9 -0
  478. data/lib/schematic/types/api_key_create_response_data.rb +18 -0
  479. data/lib/schematic/types/api_key_response_data.rb +17 -0
  480. data/lib/schematic/types/api_key_scope.rb +14 -0
  481. data/lib/schematic/types/audit_log_list_response_data.rb +23 -0
  482. data/lib/schematic/types/audit_log_response_data.rb +26 -0
  483. data/lib/schematic/types/billing_coupon_response_data.rb +25 -0
  484. data/lib/schematic/types/billing_credit_bundle_response_data.rb +29 -0
  485. data/lib/schematic/types/billing_credit_bundle_status.rb +12 -0
  486. data/lib/schematic/types/billing_credit_bundle_type.rb +23 -0
  487. data/lib/schematic/types/billing_credit_bundle_view.rb +28 -0
  488. data/lib/schematic/types/billing_credit_burn_strategy.rb +14 -0
  489. data/lib/schematic/types/billing_credit_expiry_type.rb +15 -0
  490. data/lib/schematic/types/billing_credit_expiry_unit.rb +12 -0
  491. data/lib/schematic/types/billing_credit_grant_reason.rb +15 -0
  492. data/lib/schematic/types/billing_credit_grant_response_data.rb +32 -0
  493. data/lib/schematic/types/billing_credit_grant_zeroed_out_reason.rb +14 -0
  494. data/lib/schematic/types/billing_credit_ledger_response_data.rb +14 -0
  495. data/lib/schematic/types/billing_credit_response_data.rb +24 -0
  496. data/lib/schematic/types/billing_credit_rollover_policy.rb +13 -0
  497. data/lib/schematic/types/billing_credit_view.rb +27 -0
  498. data/lib/schematic/types/billing_customer_response_data.rb +16 -0
  499. data/lib/schematic/types/billing_customer_subscription.rb +14 -0
  500. data/lib/schematic/types/billing_customer_with_subscriptions_response_data.rb +17 -0
  501. data/lib/schematic/types/billing_meter_response_data.rb +14 -0
  502. data/lib/schematic/types/billing_plan_credit_grant_reset_cadence.rb +14 -0
  503. data/lib/schematic/types/billing_plan_credit_grant_reset_start.rb +12 -0
  504. data/lib/schematic/types/billing_plan_credit_grant_reset_type.rb +12 -0
  505. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +34 -0
  506. data/lib/schematic/types/billing_price_response_data.rb +16 -0
  507. data/lib/schematic/types/billing_price_scheme.rb +12 -0
  508. data/lib/schematic/types/billing_price_usage_type.rb +12 -0
  509. data/lib/schematic/types/billing_price_view.rb +30 -0
  510. data/lib/schematic/types/billing_product_detail_response_data.rb +23 -0
  511. data/lib/schematic/types/billing_product_for_subscription_response_data.rb +30 -0
  512. data/lib/schematic/types/billing_product_plan_response_data.rb +19 -0
  513. data/lib/schematic/types/billing_product_price_interval.rb +14 -0
  514. data/lib/schematic/types/billing_product_price_response_data.rb +24 -0
  515. data/lib/schematic/types/billing_product_price_tier_response_data.rb +12 -0
  516. data/lib/schematic/types/billing_product_pricing.rb +20 -0
  517. data/lib/schematic/types/billing_product_response_data.rb +21 -0
  518. data/lib/schematic/types/billing_provider_type.rb +12 -0
  519. data/lib/schematic/types/billing_subscription_discount.rb +15 -0
  520. data/lib/schematic/types/billing_subscription_discount_view.rb +22 -0
  521. data/lib/schematic/types/billing_subscription_response_data.rb +28 -0
  522. data/lib/schematic/types/billing_subscription_trial_end_setting.rb +12 -0
  523. data/lib/schematic/types/billing_subscription_view.rb +32 -0
  524. data/lib/schematic/types/billing_tiers_mode.rb +12 -0
  525. data/lib/schematic/types/capture_raw_event.rb +13 -0
  526. data/lib/schematic/types/capture_raw_event_batch.rb +9 -0
  527. data/lib/schematic/types/change_subscription_internal_request_body.rb +18 -0
  528. data/lib/schematic/types/change_subscription_request_body.rb +17 -0
  529. data/lib/schematic/types/charge_type.rb +13 -0
  530. data/lib/schematic/types/check_flag_request_body.rb +10 -0
  531. data/lib/schematic/types/check_flag_response_data.rb +23 -0
  532. data/lib/schematic/types/check_flags_bulk_response_data.rb +9 -0
  533. data/lib/schematic/types/check_flags_response_data.rb +10 -0
  534. data/lib/schematic/types/checkout_data_response_data.rb +18 -0
  535. data/lib/schematic/types/checkout_settings_response_data.rb +11 -0
  536. data/lib/schematic/types/checkout_subscription.rb +30 -0
  537. data/lib/schematic/types/company_detail_response_data.rb +31 -0
  538. data/lib/schematic/types/company_event_period_metrics_response_data.rb +19 -0
  539. data/lib/schematic/types/company_ledger_response_data.rb +11 -0
  540. data/lib/schematic/types/company_membership_detail_response_data.rb +14 -0
  541. data/lib/schematic/types/company_membership_response_data.rb +13 -0
  542. data/lib/schematic/types/company_override_note_response_data.rb +14 -0
  543. data/lib/schematic/types/company_override_response_data.rb +28 -0
  544. data/lib/schematic/types/company_plan_detail_response_data.rb +43 -0
  545. data/lib/schematic/types/company_plan_invalid_reason.rb +12 -0
  546. data/lib/schematic/types/company_plan_with_billing_sub_view.rb +19 -0
  547. data/lib/schematic/types/company_response_data.rb +15 -0
  548. data/lib/schematic/types/company_subscription_response_data.rb +22 -0
  549. data/lib/schematic/types/compatible_plans.rb +10 -0
  550. data/lib/schematic/types/compatible_plans_response_data.rb +10 -0
  551. data/lib/schematic/types/component_capabilities.rb +10 -0
  552. data/lib/schematic/types/component_checkout_settings.rb +12 -0
  553. data/lib/schematic/types/component_display_settings.rb +14 -0
  554. data/lib/schematic/types/component_entity_type.rb +12 -0
  555. data/lib/schematic/types/component_hydrate_response_data.rb +34 -0
  556. data/lib/schematic/types/component_preview_response_data.rb +35 -0
  557. data/lib/schematic/types/component_response_data.rb +15 -0
  558. data/lib/schematic/types/component_settings_response_data.rb +14 -0
  559. data/lib/schematic/types/component_state.rb +12 -0
  560. data/lib/schematic/types/condition.rb +23 -0
  561. data/lib/schematic/types/condition_condition_type.rb +19 -0
  562. data/lib/schematic/types/condition_group.rb +9 -0
  563. data/lib/schematic/types/condition_group_response_data.rb +15 -0
  564. data/lib/schematic/types/condition_group_view.rb +16 -0
  565. data/lib/schematic/types/condition_metric_period.rb +14 -0
  566. data/lib/schematic/types/condition_metric_period_month_reset.rb +12 -0
  567. data/lib/schematic/types/condition_operator.rb +18 -0
  568. data/lib/schematic/types/condition_response_data.rb +32 -0
  569. data/lib/schematic/types/condition_view.rb +39 -0
  570. data/lib/schematic/types/count_response.rb +9 -0
  571. data/lib/schematic/types/coupon_request_body.rb +16 -0
  572. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +26 -0
  573. data/lib/schematic/types/create_billing_price_tier_request_body.rb +14 -0
  574. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +36 -0
  575. data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period.rb +14 -0
  576. data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.rb +12 -0
  577. data/lib/schematic/types/create_entitlement_req_common.rb +17 -0
  578. data/lib/schematic/types/create_entitlement_req_common_metric_period.rb +14 -0
  579. data/lib/schematic/types/create_entitlement_req_common_metric_period_month_reset.rb +12 -0
  580. data/lib/schematic/types/create_event_request_body.rb +11 -0
  581. data/lib/schematic/types/create_flag_request_body.rb +15 -0
  582. data/lib/schematic/types/create_or_update_condition_group_request_body.rb +11 -0
  583. data/lib/schematic/types/create_or_update_condition_request_body.rb +21 -0
  584. data/lib/schematic/types/create_or_update_condition_request_body_condition_type.rb +17 -0
  585. data/lib/schematic/types/create_or_update_condition_request_body_metric_period.rb +14 -0
  586. data/lib/schematic/types/create_or_update_condition_request_body_metric_period_month_reset.rb +12 -0
  587. data/lib/schematic/types/create_or_update_condition_request_body_operator.rb +18 -0
  588. data/lib/schematic/types/create_or_update_flag_request_body.rb +16 -0
  589. data/lib/schematic/types/create_or_update_rule_request_body.rb +15 -0
  590. data/lib/schematic/types/create_or_update_rule_request_body_rule_type.rb +15 -0
  591. data/lib/schematic/types/create_plan_request_body.rb +12 -0
  592. data/lib/schematic/types/create_price_tier_request_body.rb +12 -0
  593. data/lib/schematic/types/credit_auto_topup_amount_type.rb +23 -0
  594. data/lib/schematic/types/credit_bundle_currency_price.rb +10 -0
  595. data/lib/schematic/types/credit_bundle_currency_price_request_body.rb +11 -0
  596. data/lib/schematic/types/credit_bundle_currency_price_response_data.rb +10 -0
  597. data/lib/schematic/types/credit_bundle_purchase_response_data.rb +11 -0
  598. data/lib/schematic/types/credit_company_grant_view.rb +40 -0
  599. data/lib/schematic/types/credit_currency_price_request_body.rb +11 -0
  600. data/lib/schematic/types/credit_currency_price_response_data.rb +10 -0
  601. data/lib/schematic/types/credit_event_ledger_response_data.rb +39 -0
  602. data/lib/schematic/types/credit_event_type.rb +14 -0
  603. data/lib/schematic/types/credit_grant_detail.rb +12 -0
  604. data/lib/schematic/types/credit_grant_expiry_request_body.rb +14 -0
  605. data/lib/schematic/types/credit_grant_sort_order.rb +14 -0
  606. data/lib/schematic/types/credit_ledger_enriched_entry_response_data.rb +30 -0
  607. data/lib/schematic/types/credit_ledger_period.rb +14 -0
  608. data/lib/schematic/types/credit_transfer_response_data.rb +14 -0
  609. data/lib/schematic/types/credit_transfer_view.rb +14 -0
  610. data/lib/schematic/types/credit_trigger_config.rb +9 -0
  611. data/lib/schematic/types/credit_usage.rb +17 -0
  612. data/lib/schematic/types/credit_usage_aggregation.rb +12 -0
  613. data/lib/schematic/types/credits_auto_topup_company_summary.rb +10 -0
  614. data/lib/schematic/types/credits_auto_topup_credit_summary.rb +10 -0
  615. data/lib/schematic/types/credits_auto_topup_hard_failure.rb +12 -0
  616. data/lib/schematic/types/credits_auto_topup_retry_failure.rb +13 -0
  617. data/lib/schematic/types/currency_price_request_body.rb +15 -0
  618. data/lib/schematic/types/custom_plan_config.rb +11 -0
  619. data/lib/schematic/types/custom_plan_view_config_response_data.rb +11 -0
  620. data/lib/schematic/types/data_event_payload.rb +12 -0
  621. data/lib/schematic/types/data_export_output_file_type.rb +23 -0
  622. data/lib/schematic/types/data_export_response_data.rb +17 -0
  623. data/lib/schematic/types/data_export_status.rb +13 -0
  624. data/lib/schematic/types/data_export_type.rb +23 -0
  625. data/lib/schematic/types/datastream_company_plan.rb +11 -0
  626. data/lib/schematic/types/delete_billing_plan_credit_grant_request_body.rb +9 -0
  627. data/lib/schematic/types/delete_response.rb +9 -0
  628. data/lib/schematic/types/duplicate_plan_entitlements_response_response_data.rb +10 -0
  629. data/lib/schematic/types/entitlement_currency_prices_response_data.rb +11 -0
  630. data/lib/schematic/types/entitlement_price_behavior.rb +15 -0
  631. data/lib/schematic/types/entitlement_trigger_config.rb +9 -0
  632. data/lib/schematic/types/entitlement_type.rb +13 -0
  633. data/lib/schematic/types/entitlement_value_type.rb +16 -0
  634. data/lib/schematic/types/entitlements_in_plan.rb +10 -0
  635. data/lib/schematic/types/entity_key_definition_response_data.rb +13 -0
  636. data/lib/schematic/types/entity_key_detail_response_data.rb +18 -0
  637. data/lib/schematic/types/entity_key_response_data.rb +17 -0
  638. data/lib/schematic/types/entity_trait_definition_response_data.rb +15 -0
  639. data/lib/schematic/types/entity_trait_detail_response_data.rb +15 -0
  640. data/lib/schematic/types/entity_trait_response_data.rb +14 -0
  641. data/lib/schematic/types/entity_trait_value.rb +10 -0
  642. data/lib/schematic/types/entity_type.rb +12 -0
  643. data/lib/schematic/types/environment_detail_response_data.rb +14 -0
  644. data/lib/schematic/types/environment_response_data.rb +13 -0
  645. data/lib/schematic/types/environment_type.rb +13 -0
  646. data/lib/schematic/types/event_body.rb +13 -0
  647. data/lib/schematic/types/event_body_flag_check.rb +18 -0
  648. data/lib/schematic/types/event_body_identify.rb +12 -0
  649. data/lib/schematic/types/event_body_identify_company.rb +12 -0
  650. data/lib/schematic/types/event_body_track.rb +13 -0
  651. data/lib/schematic/types/event_detail_response_data.rb +30 -0
  652. data/lib/schematic/types/event_response_data.rb +27 -0
  653. data/lib/schematic/types/event_status.rb +15 -0
  654. data/lib/schematic/types/event_summary_response_data.rb +14 -0
  655. data/lib/schematic/types/event_type.rb +13 -0
  656. data/lib/schematic/types/feature_company_response_data.rb +44 -0
  657. data/lib/schematic/types/feature_company_user_response_data.rb +21 -0
  658. data/lib/schematic/types/feature_detail_response_data.rb +25 -0
  659. data/lib/schematic/types/feature_entitlement.rb +22 -0
  660. data/lib/schematic/types/feature_entitlement_metric_period.rb +14 -0
  661. data/lib/schematic/types/feature_entitlement_month_reset.rb +12 -0
  662. data/lib/schematic/types/feature_ledger_response_data.rb +12 -0
  663. data/lib/schematic/types/feature_lifecycle_phase.rb +19 -0
  664. data/lib/schematic/types/feature_response_data.rb +21 -0
  665. data/lib/schematic/types/feature_type.rb +13 -0
  666. data/lib/schematic/types/feature_usage_detail_response_data.rb +9 -0
  667. data/lib/schematic/types/feature_usage_legacy_response_data.rb +14 -0
  668. data/lib/schematic/types/feature_usage_response_data.rb +42 -0
  669. data/lib/schematic/types/feature_usage_time_series_response_data.rb +13 -0
  670. data/lib/schematic/types/feature_view.rb +26 -0
  671. data/lib/schematic/types/flag_detail_response_data.rb +21 -0
  672. data/lib/schematic/types/flag_response_data.rb +18 -0
  673. data/lib/schematic/types/flag_type.rb +23 -0
  674. data/lib/schematic/types/flag_view.rb +22 -0
  675. data/lib/schematic/types/generic_preview_object.rb +12 -0
  676. data/lib/schematic/types/invoice_request_body.rb +20 -0
  677. data/lib/schematic/types/invoice_response_data.rb +27 -0
  678. data/lib/schematic/types/invoice_status.rb +15 -0
  679. data/lib/schematic/types/issue_temporary_access_token_response_data.rb +16 -0
  680. data/lib/schematic/types/keys_request_body.rb +9 -0
  681. data/lib/schematic/types/limit_time_series_point_response_data.rb +14 -0
  682. data/lib/schematic/types/manage_plan_preview_response_response_data.rb +9 -0
  683. data/lib/schematic/types/manage_plan_request.rb +21 -0
  684. data/lib/schematic/types/manage_plan_response_response_data.rb +10 -0
  685. data/lib/schematic/types/meter_request_body.rb +11 -0
  686. data/lib/schematic/types/ordered_plans_in_group.rb +10 -0
  687. data/lib/schematic/types/payment_method_request_body.rb +19 -0
  688. data/lib/schematic/types/payment_method_response_data.rb +26 -0
  689. data/lib/schematic/types/plan_bundle_action.rb +13 -0
  690. data/lib/schematic/types/plan_bundle_credit_grant_request_body.rb +13 -0
  691. data/lib/schematic/types/plan_bundle_entitlement_request_body.rb +11 -0
  692. data/lib/schematic/types/plan_bundle_response_data.rb +13 -0
  693. data/lib/schematic/types/plan_change_action.rb +21 -0
  694. data/lib/schematic/types/plan_change_base_plan_action.rb +14 -0
  695. data/lib/schematic/types/plan_change_response_data.rb +30 -0
  696. data/lib/schematic/types/plan_change_subscription_action.rb +17 -0
  697. data/lib/schematic/types/plan_controlled_by_type.rb +12 -0
  698. data/lib/schematic/types/plan_credit_grant_view.rb +35 -0
  699. data/lib/schematic/types/plan_currency_price_request_body.rb +12 -0
  700. data/lib/schematic/types/plan_currency_prices_response_data.rb +12 -0
  701. data/lib/schematic/types/plan_detail_response_data.rb +33 -0
  702. data/lib/schematic/types/plan_entitlement_response_data.rb +34 -0
  703. data/lib/schematic/types/plan_entitlements_order.rb +10 -0
  704. data/lib/schematic/types/plan_group_bundle_order.rb +9 -0
  705. data/lib/schematic/types/plan_group_detail_response_data.rb +45 -0
  706. data/lib/schematic/types/plan_group_plan_detail_response_data.rb +37 -0
  707. data/lib/schematic/types/plan_group_plan_entitlements_order.rb +10 -0
  708. data/lib/schematic/types/plan_group_response_data.rb +36 -0
  709. data/lib/schematic/types/plan_issue_response_data.rb +12 -0
  710. data/lib/schematic/types/plan_response_data.rb +16 -0
  711. data/lib/schematic/types/plan_selection.rb +11 -0
  712. data/lib/schematic/types/plan_snapshot_view.rb +13 -0
  713. data/lib/schematic/types/plan_trait_response_data.rb +17 -0
  714. data/lib/schematic/types/plan_type.rb +12 -0
  715. data/lib/schematic/types/plan_version_company_migration_response_data.rb +19 -0
  716. data/lib/schematic/types/plan_version_company_migration_status.rb +15 -0
  717. data/lib/schematic/types/plan_version_migration_response_data.rb +23 -0
  718. data/lib/schematic/types/plan_version_migration_status.rb +14 -0
  719. data/lib/schematic/types/plan_version_migration_strategy.rb +12 -0
  720. data/lib/schematic/types/plan_version_response_data.rb +19 -0
  721. data/lib/schematic/types/plan_version_snapshot_view.rb +11 -0
  722. data/lib/schematic/types/plan_version_status.rb +13 -0
  723. data/lib/schematic/types/plan_view_public_response_data.rb +38 -0
  724. data/lib/schematic/types/preview_object.rb +12 -0
  725. data/lib/schematic/types/preview_object_response_data.rb +12 -0
  726. data/lib/schematic/types/preview_subscription_change_response_data.rb +21 -0
  727. data/lib/schematic/types/preview_subscription_finance_response_data.rb +21 -0
  728. data/lib/schematic/types/preview_subscription_upcoming_invoice_line_items.rb +13 -0
  729. data/lib/schematic/types/proration_behavior.rb +12 -0
  730. data/lib/schematic/types/public_plans_response_data.rb +17 -0
  731. data/lib/schematic/types/quickstart_resp.rb +9 -0
  732. data/lib/schematic/types/raw_event_batch_response_data.rb +9 -0
  733. data/lib/schematic/types/raw_event_response_data.rb +13 -0
  734. data/lib/schematic/types/rule.rb +18 -0
  735. data/lib/schematic/types/rule_condition_detail_response_data.rb +29 -0
  736. data/lib/schematic/types/rule_condition_group_detail_response_data.rb +15 -0
  737. data/lib/schematic/types/rule_condition_group_response_data.rb +14 -0
  738. data/lib/schematic/types/rule_condition_response_data.rb +26 -0
  739. data/lib/schematic/types/rule_detail_response_data.rb +19 -0
  740. data/lib/schematic/types/rule_response_data.rb +17 -0
  741. data/lib/schematic/types/rule_rule_type.rb +17 -0
  742. data/lib/schematic/types/rule_view.rb +20 -0
  743. data/lib/schematic/types/rules_detail_response_data.rb +10 -0
  744. data/lib/schematic/types/rules_engine_schema_version.rb +12 -0
  745. data/lib/schematic/types/rulesengine_check_flag_result.rb +23 -0
  746. data/lib/schematic/types/rulesengine_check_flag_result_feature_usage_period.rb +14 -0
  747. data/lib/schematic/types/rulesengine_check_flag_result_rule_type.rb +17 -0
  748. data/lib/schematic/types/rulesengine_company.rb +22 -0
  749. data/lib/schematic/types/rulesengine_company_metric.rb +17 -0
  750. data/lib/schematic/types/rulesengine_company_metric_month_reset.rb +12 -0
  751. data/lib/schematic/types/rulesengine_company_metric_period.rb +14 -0
  752. data/lib/schematic/types/rulesengine_condition.rb +23 -0
  753. data/lib/schematic/types/rulesengine_condition_condition_type.rb +19 -0
  754. data/lib/schematic/types/rulesengine_condition_group.rb +9 -0
  755. data/lib/schematic/types/rulesengine_condition_metric_period.rb +14 -0
  756. data/lib/schematic/types/rulesengine_condition_metric_period_month_reset.rb +12 -0
  757. data/lib/schematic/types/rulesengine_condition_operator.rb +18 -0
  758. data/lib/schematic/types/rulesengine_entitlement_value_type.rb +16 -0
  759. data/lib/schematic/types/rulesengine_entity_type.rb +12 -0
  760. data/lib/schematic/types/rulesengine_feature_entitlement.rb +22 -0
  761. data/lib/schematic/types/rulesengine_feature_entitlement_metric_period.rb +14 -0
  762. data/lib/schematic/types/rulesengine_feature_entitlement_month_reset.rb +12 -0
  763. data/lib/schematic/types/rulesengine_flag.rb +14 -0
  764. data/lib/schematic/types/rulesengine_rule.rb +18 -0
  765. data/lib/schematic/types/rulesengine_rule_rule_type.rb +17 -0
  766. data/lib/schematic/types/rulesengine_subscription.rb +11 -0
  767. data/lib/schematic/types/rulesengine_trait.rb +10 -0
  768. data/lib/schematic/types/rulesengine_trait_definition.rb +11 -0
  769. data/lib/schematic/types/rulesengine_trait_definition_comparable_type.rb +14 -0
  770. data/lib/schematic/types/rulesengine_user.rb +14 -0
  771. data/lib/schematic/types/scheduled_checkout_response_data.rb +22 -0
  772. data/lib/schematic/types/scheduled_checkout_status.rb +15 -0
  773. data/lib/schematic/types/scheduled_downgrade_config_behavior.rb +12 -0
  774. data/lib/schematic/types/scheduled_downgrade_response_data.rb +19 -0
  775. data/lib/schematic/types/segment_status_resp.rb +11 -0
  776. data/lib/schematic/types/skipped_entitlement_error_response_data.rb +9 -0
  777. data/lib/schematic/types/skipped_entitlement_response_data.rb +12 -0
  778. data/lib/schematic/types/sort_direction.rb +12 -0
  779. data/lib/schematic/types/stripe_embed_info.rb +12 -0
  780. data/lib/schematic/types/subscription_status.rb +19 -0
  781. data/lib/schematic/types/subscription_trait_update.rb +15 -0
  782. data/lib/schematic/types/subscription_type.rb +14 -0
  783. data/lib/schematic/types/temporary_access_token_resource_type.rb +23 -0
  784. data/lib/schematic/types/temporary_access_token_response_data.rb +15 -0
  785. data/lib/schematic/types/time_series_granularity.rb +14 -0
  786. data/lib/schematic/types/trait_definition.rb +11 -0
  787. data/lib/schematic/types/trait_definition_comparable_type.rb +14 -0
  788. data/lib/schematic/types/trait_type.rb +16 -0
  789. data/lib/schematic/types/update_add_on_request_body.rb +10 -0
  790. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +23 -0
  791. data/lib/schematic/types/update_credit_bundle_request_body.rb +10 -0
  792. data/lib/schematic/types/update_entitlement_req_common.rb +16 -0
  793. data/lib/schematic/types/update_entitlement_req_common_metric_period.rb +14 -0
  794. data/lib/schematic/types/update_entitlement_req_common_metric_period_month_reset.rb +12 -0
  795. data/lib/schematic/types/update_pay_in_advance_request_body.rb +10 -0
  796. data/lib/schematic/types/update_plan_request_body.rb +11 -0
  797. data/lib/schematic/types/update_plan_trait_trait_request_body.rb +10 -0
  798. data/lib/schematic/types/update_rule_request_body.rb +13 -0
  799. data/lib/schematic/types/upsert_billing_product_request_body.rb +20 -0
  800. data/lib/schematic/types/upsert_company_request_body.rb +15 -0
  801. data/lib/schematic/types/upsert_trait_request_body.rb +13 -0
  802. data/lib/schematic/types/upsert_user_request_body.rb +18 -0
  803. data/lib/schematic/types/upsert_user_sub_request_body.rb +16 -0
  804. data/lib/schematic/types/usage_based_entitlement_request_body.rb +25 -0
  805. data/lib/schematic/types/usage_based_entitlement_response_data.rb +20 -0
  806. data/lib/schematic/types/usage_time_series_point_response_data.rb +12 -0
  807. data/lib/schematic/types/user_detail_response_data.rb +18 -0
  808. data/lib/schematic/types/user_response_data.rb +14 -0
  809. data/lib/schematic/types/web_feature_usage_webhook_output.rb +15 -0
  810. data/lib/schematic/types/web_scheduled_downgrade_webhook_output.rb +15 -0
  811. data/lib/schematic/types/webhook_event_detail_response_data.rb +18 -0
  812. data/lib/schematic/types/webhook_event_response_data.rb +17 -0
  813. data/lib/schematic/types/webhook_event_status.rb +13 -0
  814. data/lib/schematic/types/webhook_request_type.rb +49 -0
  815. data/lib/schematic/types/webhook_response_data.rb +18 -0
  816. data/lib/schematic/types/webhook_status.rb +12 -0
  817. data/lib/schematic/types/who_am_i_response_data.rb +17 -0
  818. data/lib/schematic/version.rb +5 -0
  819. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  820. data/lib/schematic/webhook_verification.rb +83 -0
  821. data/lib/schematic/webhooks/client.rb +355 -0
  822. data/lib/schematic/webhooks/types/count_webhook_events_params.rb +16 -0
  823. data/lib/schematic/webhooks/types/count_webhook_events_request.rb +15 -0
  824. data/lib/schematic/webhooks/types/count_webhook_events_response.rb +12 -0
  825. data/lib/schematic/webhooks/types/count_webhooks_params.rb +14 -0
  826. data/lib/schematic/webhooks/types/count_webhooks_request.rb +13 -0
  827. data/lib/schematic/webhooks/types/count_webhooks_response.rb +12 -0
  828. data/lib/schematic/webhooks/types/create_webhook_request_body.rb +15 -0
  829. data/lib/schematic/webhooks/types/create_webhook_response.rb +12 -0
  830. data/lib/schematic/webhooks/types/delete_webhook_response.rb +12 -0
  831. data/lib/schematic/webhooks/types/get_webhook_event_response.rb +12 -0
  832. data/lib/schematic/webhooks/types/get_webhook_response.rb +12 -0
  833. data/lib/schematic/webhooks/types/list_webhook_events_params.rb +16 -0
  834. data/lib/schematic/webhooks/types/list_webhook_events_request.rb +15 -0
  835. data/lib/schematic/webhooks/types/list_webhook_events_response.rb +12 -0
  836. data/lib/schematic/webhooks/types/list_webhooks_params.rb +14 -0
  837. data/lib/schematic/webhooks/types/list_webhooks_request.rb +13 -0
  838. data/lib/schematic/webhooks/types/list_webhooks_response.rb +12 -0
  839. data/lib/schematic/webhooks/types/update_webhook_request_body.rb +17 -0
  840. data/lib/schematic/webhooks/types/update_webhook_response.rb +12 -0
  841. data/lib/schematic.rb +821 -0
  842. data/lib/schematichq.rb +17 -0
  843. data/reference.md +16668 -0
  844. data/scripts/download-wasm.sh +82 -0
  845. data/scripts/webhook_test_server.rb +55 -0
  846. data/testapp/Gemfile +6 -0
  847. data/testapp/app.rb +307 -0
  848. metadata +917 -0
data/README.md ADDED
@@ -0,0 +1,639 @@
1
+ # schematic-ruby
2
+
3
+ ## Installation and Setup
4
+
5
+ 1. Install the Ruby gem:
6
+
7
+ ```bash
8
+ gem install schematichq
9
+ ```
10
+
11
+ Or add it to your Gemfile:
12
+
13
+ ```ruby
14
+ gem "schematichq"
15
+ ```
16
+
17
+ Then run:
18
+
19
+ ```bash
20
+ bundle install
21
+ ```
22
+
23
+ 2. [Issue an API key](https://docs.schematichq.com/quickstart#create-an-api-key) for the appropriate environment using the [Schematic app](https://app.schematichq.com/settings/api-keys). Be sure to capture the secret key when you issue the API key; you'll only see this key once, and this is what you'll use with schematic-ruby.
24
+
25
+ 3. Using this secret key, initialize a client in your application:
26
+
27
+ ```ruby
28
+ require "schematichq"
29
+
30
+ api_key = ENV["SCHEMATIC_API_KEY"]
31
+ client = Schematic::SchematicClient.new(api_key: api_key)
32
+
33
+ # interactions with the client
34
+
35
+ client.close
36
+ ```
37
+
38
+ By default, the client will do some local caching for flag checks. If you would like to change this behavior, you can do so using an initialization option to specify the max size of the cache (in terms of number of records) and the max age of the cache (in seconds):
39
+
40
+ ```ruby
41
+ require "schematichq"
42
+
43
+ api_key = ENV["SCHEMATIC_API_KEY"]
44
+ cache_size = 100
45
+ cache_ttl = 1.0 # in seconds
46
+ client = Schematic::SchematicClient.new(
47
+ api_key: api_key,
48
+ cache_providers: [
49
+ Schematic::LocalCache.new(max_size: cache_size, ttl: cache_ttl)
50
+ ]
51
+ )
52
+
53
+ # interactions with the client
54
+
55
+ client.close
56
+ ```
57
+
58
+ You can also disable local caching entirely with an initialization option; bear in mind that, in this case, every flag check will result in a network request:
59
+
60
+ ```ruby
61
+ require "schematichq"
62
+
63
+ api_key = ENV["SCHEMATIC_API_KEY"]
64
+ client = Schematic::SchematicClient.new(
65
+ api_key: api_key,
66
+ cache_providers: []
67
+ )
68
+
69
+ # interactions with the client
70
+
71
+ client.close
72
+ ```
73
+
74
+ You may want to specify default flag values for your application, which will be used if there is a service interruption or if the client is running in offline mode (see below). You can do this using an initialization option:
75
+
76
+ ```ruby
77
+ require "schematichq"
78
+
79
+ api_key = ENV["SCHEMATIC_API_KEY"]
80
+ client = Schematic::SchematicClient.new(
81
+ api_key: api_key,
82
+ flag_defaults: {
83
+ "some-flag-key" => true
84
+ }
85
+ )
86
+
87
+ # interactions with the client
88
+
89
+ client.close
90
+ ```
91
+
92
+ ### Custom Logging
93
+
94
+ You can provide your own logger implementation to control how the Schematic client logs messages. The logger must implement the `Schematic::Logger` module with `error`, `warn`, `info`, and `debug` methods:
95
+
96
+ ```ruby
97
+ require "schematichq"
98
+
99
+ class CustomLogger
100
+ include Schematic::Logger
101
+
102
+ def error(message, *args)
103
+ # Your custom error logging logic
104
+ end
105
+
106
+ def warn(message, *args)
107
+ # Your custom warning logging logic
108
+ end
109
+
110
+ def info(message, *args)
111
+ # Your custom info logging logic
112
+ end
113
+
114
+ def debug(message, *args)
115
+ # Your custom debug logging logic
116
+ end
117
+ end
118
+
119
+ api_key = ENV["SCHEMATIC_API_KEY"]
120
+ client = Schematic::SchematicClient.new(
121
+ api_key: api_key,
122
+ logger: CustomLogger.new
123
+ )
124
+
125
+ # interactions with the client
126
+
127
+ client.close
128
+ ```
129
+
130
+ You can also adjust the log level of the built-in console logger:
131
+
132
+ ```ruby
133
+ require "schematichq"
134
+
135
+ api_key = ENV["SCHEMATIC_API_KEY"]
136
+ client = Schematic::SchematicClient.new(
137
+ api_key: api_key,
138
+ logger: Schematic::ConsoleLogger.new(level: :debug)
139
+ )
140
+ ```
141
+
142
+ If no logger is provided, the client will use a default console logger at the `:info` level that outputs to stderr.
143
+
144
+ ## Usage Examples
145
+
146
+ A number of these examples use `keys` to identify companies and users. Learn more about keys [here](https://docs.schematichq.com/developer_resources/key_management).
147
+
148
+ ### Sending identify events
149
+
150
+ Create or update users and companies using identify events.
151
+
152
+ ```ruby
153
+ require "schematichq"
154
+
155
+ api_key = ENV["SCHEMATIC_API_KEY"]
156
+ client = Schematic::SchematicClient.new(api_key: api_key)
157
+
158
+ client.identify({
159
+ company: {
160
+ keys: { "id" => "your-company-id" },
161
+ name: "Acme, Inc.",
162
+ traits: { "city" => "Atlanta" }
163
+ },
164
+ keys: {
165
+ "email" => "wcoyote@acme.net",
166
+ "user_id" => "your-user-id"
167
+ },
168
+ name: "Wile E. Coyote",
169
+ traits: {
170
+ "enemy" => "Bugs Bunny",
171
+ "login_count" => 24,
172
+ "is_staff" => false
173
+ }
174
+ })
175
+
176
+ client.close
177
+ ```
178
+
179
+ This call is non-blocking and there is no response to check.
180
+
181
+ ### Sending track events
182
+
183
+ Track activity in your application using track events; these events can later be used to produce metrics for targeting.
184
+
185
+ ```ruby
186
+ require "schematichq"
187
+
188
+ api_key = ENV["SCHEMATIC_API_KEY"]
189
+ client = Schematic::SchematicClient.new(api_key: api_key)
190
+
191
+ client.track({
192
+ event: "some-action",
193
+ company: { "id" => "your-company-id" },
194
+ user: {
195
+ "email" => "wcoyote@acme.net",
196
+ "user_id" => "your-user-id"
197
+ }
198
+ })
199
+
200
+ client.close
201
+ ```
202
+
203
+ This call is non-blocking and there is no response to check.
204
+
205
+ If you want to record large numbers of the same event at once, or perhaps measure usage in terms of a unit like tokens or memory, you can optionally specify a quantity for your event:
206
+
207
+ ```ruby
208
+ client.track({
209
+ event: "query-tokens",
210
+ company: { "id" => "your-company-id" },
211
+ user: {
212
+ "email" => "wcoyote@acme.net",
213
+ "user_id" => "your-user-id"
214
+ },
215
+ quantity: 1500
216
+ })
217
+ ```
218
+
219
+ ### Creating and updating companies
220
+
221
+ Although it is faster to create companies and users via identify events, if you need to handle a response, you can use the companies API to upsert companies. Because you use your own identifiers to identify companies, rather than a Schematic company ID, creating and updating companies are both done via the same upsert operation:
222
+
223
+ ```ruby
224
+ require "schematichq"
225
+
226
+ api_key = ENV["SCHEMATIC_API_KEY"]
227
+ client = Schematic::SchematicClient.new(api_key: api_key)
228
+
229
+ response = client.companies.upsert_company(
230
+ keys: { "id" => "your-company-id" },
231
+ name: "Acme Widgets, Inc.",
232
+ traits: {
233
+ "city" => "Atlanta",
234
+ "high_score" => 25,
235
+ "is_active" => true
236
+ }
237
+ )
238
+ puts response.data
239
+
240
+ client.close
241
+ ```
242
+
243
+ You can define any number of company keys; these are used to address the company in the future, for example by updating the company's traits or checking a flag for the company.
244
+
245
+ You can also define any number of company traits; these can then be used as targeting parameters.
246
+
247
+ ### Creating and updating users
248
+
249
+ Similarly, you can upsert users using the Schematic API, as an alternative to using identify events. Because you use your own identifiers to identify users, rather than a Schematic user ID, creating and updating users are both done via the same upsert operation:
250
+
251
+ ```ruby
252
+ require "schematichq"
253
+
254
+ api_key = ENV["SCHEMATIC_API_KEY"]
255
+ client = Schematic::SchematicClient.new(api_key: api_key)
256
+
257
+ response = client.companies.upsert_user(
258
+ keys: {
259
+ "email" => "wcoyote@acme.net",
260
+ "user_id" => "your-user-id"
261
+ },
262
+ company: { "id" => "your-company-id" },
263
+ name: "Wile E. Coyote",
264
+ traits: {
265
+ "city" => "Atlanta",
266
+ "login_count" => 24,
267
+ "is_staff" => false
268
+ }
269
+ )
270
+ puts response.data
271
+
272
+ client.close
273
+ ```
274
+
275
+ You can define any number of user keys; these are used to address the user in the future, for example by updating the user's traits or checking a flag for the user.
276
+
277
+ You can also define any number of user traits; these can then be used as targeting parameters.
278
+
279
+ ### Checking flags
280
+
281
+ When checking a flag, you'll provide keys for a company and/or keys for a user. You can also provide no keys at all, in which case you'll get the default value for the flag.
282
+
283
+ ```ruby
284
+ require "schematichq"
285
+
286
+ api_key = ENV["SCHEMATIC_API_KEY"]
287
+ client = Schematic::SchematicClient.new(api_key: api_key)
288
+
289
+ is_flag_on = client.check_flag(
290
+ "some-flag-key",
291
+ company: { "id" => "your-company-id" },
292
+ user: {
293
+ "email" => "wcoyote@acme.net",
294
+ "user_id" => "your-user-id"
295
+ }
296
+ )
297
+
298
+ if is_flag_on
299
+ # Flag is on
300
+ else
301
+ # Flag is off
302
+ end
303
+
304
+ client.close
305
+ ```
306
+
307
+ ### Checking flags with entitlement details
308
+
309
+ If you need more detail about how a flag check was resolved, including any entitlement associated with the check, use `check_flag_with_entitlement`. This returns a response object with the flag value, the reason for the evaluation result, and entitlement details such as usage, allocation, and credit balances when applicable.
310
+
311
+ ```ruby
312
+ require "schematichq"
313
+
314
+ api_key = ENV["SCHEMATIC_API_KEY"]
315
+ client = Schematic::SchematicClient.new(api_key: api_key)
316
+
317
+ resp = client.check_flag_with_entitlement(
318
+ "some-flag-key",
319
+ company: { "id" => "your-company-id" },
320
+ user: {
321
+ "email" => "wcoyote@acme.net",
322
+ "user_id" => "your-user-id"
323
+ }
324
+ )
325
+
326
+ puts "Flag: #{resp.flag_key}, Value: #{resp.value}, Reason: #{resp.reason}"
327
+
328
+ if resp.entitlement
329
+ puts "Feature allocation: #{resp.feature_allocation}"
330
+ puts "Feature usage: #{resp.feature_usage}"
331
+ end
332
+
333
+ client.close
334
+ ```
335
+
336
+ ### Other API operations
337
+
338
+ The Schematic API supports many operations beyond these, accessible via the API modules on the client: `accounts`, `billing`, `companies`, `credits`, `entitlements`, `events`, `features`, and `plans`.
339
+
340
+ ## Webhook Verification
341
+
342
+ Schematic can send webhooks to notify your application of events. To ensure the security of these webhooks, Schematic signs each request using HMAC-SHA256. The SDK provides utility functions to verify these signatures.
343
+
344
+ ### Verifying Webhook Signatures
345
+
346
+ When your application receives a webhook request from Schematic, you should verify its signature to ensure it's authentic:
347
+
348
+ ```ruby
349
+ require "schematichq"
350
+
351
+ webhook_secret = "your-webhook-secret" # Get this from the Schematic app
352
+
353
+ # Verify a signature directly
354
+ Schematic::Webhooks.verify_signature(payload, signature, timestamp, webhook_secret)
355
+ # Raises Schematic::Webhooks::InvalidSignatureError if the signature is invalid
356
+ # Raises Schematic::Webhooks::MissingSignatureError if the signature is missing
357
+ # Raises Schematic::Webhooks::MissingTimestampError if the timestamp is missing
358
+ ```
359
+
360
+ ### Computing Signatures
361
+
362
+ You can compute a hex-encoded signature for a given payload:
363
+
364
+ ```ruby
365
+ hex_sig = Schematic::Webhooks.compute_hex_signature(body, timestamp, secret)
366
+ ```
367
+
368
+ ### Rack / Rails Integration
369
+
370
+ The SDK can verify webhook signatures from Rack-compatible request objects (including Rails controllers):
371
+
372
+ ```ruby
373
+ # In a Rails controller
374
+ class WebhooksController < ApplicationController
375
+ skip_before_action :verify_authenticity_token
376
+
377
+ def create
378
+ webhook_secret = ENV["SCHEMATIC_WEBHOOK_SECRET"]
379
+
380
+ begin
381
+ Schematic::Webhooks.verify_webhook_request(request, webhook_secret)
382
+
383
+ # Signature is valid, process the webhook
384
+ payload = JSON.parse(request.raw_post)
385
+ # ... handle the event ...
386
+
387
+ head :ok
388
+ rescue Schematic::Webhooks::WebhookSignatureError => e
389
+ render json: { error: e.message }, status: :bad_request
390
+ end
391
+ end
392
+ end
393
+ ```
394
+
395
+ For a Sinatra application:
396
+
397
+ ```ruby
398
+ require "sinatra"
399
+ require "schematichq"
400
+
401
+ post "/webhooks/schematic" do
402
+ webhook_secret = ENV["SCHEMATIC_WEBHOOK_SECRET"]
403
+
404
+ begin
405
+ Schematic::Webhooks.verify_webhook_request(request, webhook_secret)
406
+
407
+ payload = JSON.parse(request.body.read)
408
+ request.body.rewind
409
+ # ... handle the event ...
410
+
411
+ status 200
412
+ json status: "ok"
413
+ rescue Schematic::Webhooks::WebhookSignatureError => e
414
+ status 400
415
+ json error: e.message
416
+ end
417
+ end
418
+ ```
419
+
420
+ ### Webhook Test Server
421
+
422
+ The SDK includes a standalone webhook test server for local development:
423
+
424
+ ```bash
425
+ ruby scripts/webhook_test_server.rb <webhook_secret>
426
+ # or
427
+ SCHEMATIC_WEBHOOK_SECRET=your-secret ruby scripts/webhook_test_server.rb
428
+ ```
429
+
430
+ This starts a WEBrick server on port 8080 (configurable via `PORT` env var) that listens for POST requests at `/webhook`, verifies signatures, and prints the payload.
431
+
432
+ ## DataStream
433
+
434
+ DataStream enables local flag evaluation by maintaining a WebSocket connection to Schematic and caching flag rules, company, and user data locally. Flag checks are evaluated using a local WASM rules engine, significantly reducing latency and network calls.
435
+
436
+ ### Setup
437
+
438
+ ```ruby
439
+ require "schematichq"
440
+
441
+ client = Schematic::SchematicClient.new(
442
+ api_key: ENV["SCHEMATIC_API_KEY"],
443
+ use_data_stream: true
444
+ )
445
+
446
+ # Flag checks are now evaluated locally
447
+ is_flag_on = client.check_flag(
448
+ "some-flag-key",
449
+ company: { "id" => "your-company-id" }
450
+ )
451
+
452
+ client.close
453
+ ```
454
+
455
+ ### Configuration Options
456
+
457
+ You can customize DataStream behavior via the `datastream_options` hash:
458
+
459
+ | Option | Type | Default | Description |
460
+ |---|---|---|---|
461
+ | `cache_ttl` | `Integer` | 86400 (24 hours) | Cache TTL in seconds |
462
+ | `replicator_mode` | `Boolean` | `false` | Enable replicator mode (see below) |
463
+ | `replicator_health_url` | `String` | `http://localhost:8090/ready` | URL to poll for replicator health |
464
+ | `replicator_health_interval` | `Integer` | 30 | Health check interval in seconds |
465
+
466
+ ```ruby
467
+ require "schematichq"
468
+
469
+ client = Schematic::SchematicClient.new(
470
+ api_key: ENV["SCHEMATIC_API_KEY"],
471
+ use_data_stream: true,
472
+ datastream_options: {
473
+ cache_ttl: 3600 # 1 hour
474
+ }
475
+ )
476
+ ```
477
+
478
+ ## Replicator Mode
479
+
480
+ When running the `schematic-datastream-replicator` service, you can configure the Schematic client to operate in Replicator Mode. In this mode, the client reads from a shared cache populated by the external replicator rather than establishing its own WebSocket connection.
481
+
482
+ ### Setup
483
+
484
+ ```ruby
485
+ require "schematichq"
486
+
487
+ client = Schematic::SchematicClient.new(
488
+ api_key: ENV["SCHEMATIC_API_KEY"],
489
+ use_data_stream: true,
490
+ datastream_options: {
491
+ replicator_mode: true,
492
+ replicator_health_url: "http://localhost:8090/ready",
493
+ replicator_health_interval: 30
494
+ }
495
+ )
496
+
497
+ # Flag checks use the shared cache
498
+ is_flag_on = client.check_flag(
499
+ "some-flag-key",
500
+ company: { "id" => "your-company-id" }
501
+ )
502
+
503
+ client.close
504
+ ```
505
+
506
+ When running in Replicator Mode, the client will:
507
+ - Skip establishing WebSocket connections
508
+ - Periodically check if the replicator service is ready
509
+ - Use cached data populated by the external replicator service
510
+ - Fall back to direct API calls if the replicator is not available
511
+
512
+ ## Testing
513
+
514
+ ### Offline Mode
515
+
516
+ In development or testing environments, you may want to avoid making network requests to the Schematic API. You can run Schematic in offline mode by specifying the `offline` option; in this case, it does not matter what API key you specify:
517
+
518
+ ```ruby
519
+ require "schematichq"
520
+
521
+ client = Schematic::SchematicClient.new(offline: true)
522
+
523
+ client.close
524
+ ```
525
+
526
+ You can also enable offline mode by not providing an API key:
527
+
528
+ ```ruby
529
+ require "schematichq"
530
+
531
+ client = Schematic::SchematicClient.new
532
+ # Logs a warning and automatically enables offline mode
533
+
534
+ client.close
535
+ ```
536
+
537
+ Offline mode works well with flag defaults:
538
+
539
+ ```ruby
540
+ require "schematichq"
541
+
542
+ client = Schematic::SchematicClient.new(
543
+ offline: true,
544
+ flag_defaults: { "some-flag-key" => true }
545
+ )
546
+
547
+ # interactions with the client
548
+
549
+ client.close
550
+ ```
551
+
552
+ In an automated testing context, you may also want to use offline mode and specify single flag responses for test cases:
553
+
554
+ ```ruby
555
+ require "schematichq"
556
+
557
+ # In your test setup
558
+ client = Schematic::SchematicClient.new(offline: true)
559
+ client.set_flag_default("some-flag-key", true)
560
+
561
+ # test code that expects the flag to be on
562
+ assert client.check_flag("some-flag-key")
563
+
564
+ client.close
565
+ ```
566
+
567
+ ## Errors
568
+
569
+ Failed API calls will raise errors that can be rescued from granularly:
570
+
571
+ ```ruby
572
+ require "schematichq"
573
+
574
+ client = Schematic::SchematicClient.new(api_key: ENV["SCHEMATIC_API_KEY"])
575
+
576
+ begin
577
+ result = client.accounts.create_api_key(name: "name")
578
+ rescue Schematic::Errors::TimeoutError
579
+ puts "API didn't respond before our timeout elapsed"
580
+ rescue Schematic::Errors::ServiceUnavailableError
581
+ puts "API returned status 503, is probably overloaded, try again later"
582
+ rescue Schematic::Errors::ServerError
583
+ puts "API returned some other 5xx status, this is probably a bug"
584
+ rescue Schematic::Errors::ResponseError => e
585
+ puts "API returned an unexpected status other than 5xx: #{e.code} #{e.message}"
586
+ rescue Schematic::Errors::ApiError => e
587
+ puts "Some other error occurred when calling the API: #{e.message}"
588
+ end
589
+ ```
590
+
591
+ Note that `check_flag` and `check_flag_with_entitlement` never raise exceptions -- errors are logged and default values are returned.
592
+
593
+ ## Advanced
594
+
595
+ ### Retries
596
+
597
+ The SDK is instrumented with automatic retries. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).
598
+
599
+ A request is deemed retryable when any of the following HTTP status codes is returned:
600
+
601
+ - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
602
+ - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
603
+ - [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
604
+
605
+ Use the `max_retries` option to configure this behavior:
606
+
607
+ ```ruby
608
+ require "schematichq"
609
+
610
+ client = Schematic::SchematicClient.new(
611
+ api_key: ENV["SCHEMATIC_API_KEY"],
612
+ max_retries: 3 # Configure max retries (default is 2)
613
+ )
614
+ ```
615
+
616
+ ### Timeouts
617
+
618
+ The SDK defaults to a 60 second timeout. Use the `timeout` option to configure this behavior:
619
+
620
+ ```ruby
621
+ response = client.accounts.create_api_key(
622
+ name: "name",
623
+ timeout: 30 # 30 second timeout
624
+ )
625
+ ```
626
+
627
+ ## Reference
628
+
629
+ A full reference for the underlying API library is available [here](https://github.com/schematichq/schematic-ruby/blob/HEAD/./reference.md).
630
+
631
+ ## Contributing
632
+
633
+ While we value open-source contributions to this SDK, this library is generated programmatically.
634
+ Additions made directly to this library would have to be moved over to our generation code,
635
+ otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
636
+ a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
637
+ an issue first to discuss with us!
638
+
639
+ On the other hand, contributions to the README are always very welcome!
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[test]
13
+
14
+ task lint: %i[rubocop]
15
+
16
+ # Run only the custom test file
17
+ Minitest::TestTask.create(:customtest) do |t|
18
+ t.libs << "test"
19
+ t.test_globs = ["test/custom.test.rb"]
20
+ end
data/WASM_VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/custom.gemspec.rb ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ def add_custom_gemspec_data(spec)
4
+ spec.homepage = "https://github.com/SchematicHQ/schematic-ruby"
5
+
6
+ # The WASM binary is gitignored (downloaded at build time via scripts/download-wasm.sh)
7
+ # but must be included in the published gem. Append it to the file list.
8
+ wasm_file = "lib/schematic/wasm/rulesengine.wasm"
9
+ spec.files << wasm_file if File.exist?(wasm_file) && !spec.files.include?(wasm_file)
10
+ end