schematichq 1.5.3 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -4
  3. data/.fern/replay.lock +7 -1
  4. data/.fernignore +2 -0
  5. data/.rubocop.yml +4 -0
  6. data/README.md +1 -1
  7. data/WASM_VERSION +1 -1
  8. data/lib/schematic/accesstokens/client.rb +9 -1
  9. data/lib/schematic/accounts/client.rb +183 -21
  10. data/lib/schematic/billing/client.rb +325 -34
  11. data/lib/schematic/billing/types/create_billing_price_request_body.rb +1 -1
  12. data/lib/schematic/billing/types/create_billing_product_request_body.rb +1 -1
  13. data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +1 -1
  14. data/lib/schematic/billing/types/create_coupon_request_body.rb +2 -2
  15. data/lib/schematic/billing/types/create_invoice_request_body.rb +1 -1
  16. data/lib/schematic/billing/types/get_billing_settings_response.rb +13 -0
  17. data/lib/schematic/billing/types/list_billing_prices_params.rb +1 -1
  18. data/lib/schematic/billing/types/list_billing_prices_request.rb +1 -1
  19. data/lib/schematic/billing/types/list_billing_product_prices_params.rb +1 -1
  20. data/lib/schematic/billing/types/list_billing_product_prices_request.rb +1 -1
  21. data/lib/schematic/billing/types/update_billing_settings_request_body.rb +11 -0
  22. data/lib/schematic/billing/types/update_billing_settings_response.rb +13 -0
  23. data/lib/schematic/catalogs/client.rb +121 -14
  24. data/lib/schematic/checkout/client.rb +80 -9
  25. data/lib/schematic/checkout/types/checkout_data_request_body.rb +1 -1
  26. data/lib/schematic/client.rb +5 -3
  27. data/lib/schematic/companies/client.rb +380 -44
  28. data/lib/schematic/components/client.rb +70 -8
  29. data/lib/schematic/components/types/create_component_request_body.rb +1 -1
  30. data/lib/schematic/components/types/update_component_request_body.rb +1 -1
  31. data/lib/schematic/componentspublic/client.rb +8 -1
  32. data/lib/schematic/credits/client.rb +409 -41
  33. data/lib/schematic/credits/types/acquire_credit_lease_request_body.rb +1 -1
  34. data/lib/schematic/credits/types/create_billing_credit_request_body.rb +1 -1
  35. data/lib/schematic/credits/types/create_company_credit_grant.rb +1 -1
  36. data/lib/schematic/credits/types/create_credit_bundle_request_body.rb +1 -1
  37. data/lib/schematic/credits/types/create_credit_spend_policy_request_body.rb +2 -2
  38. data/lib/schematic/credits/types/extend_credit_lease_request_body.rb +1 -1
  39. data/lib/schematic/credits/types/get_credit_balance_time_series_params.rb +18 -0
  40. data/lib/schematic/credits/types/get_credit_balance_time_series_request.rb +17 -0
  41. data/lib/schematic/credits/types/get_credit_balance_time_series_response.rb +13 -0
  42. data/lib/schematic/credits/types/reserve_credits_request_body.rb +1 -1
  43. data/lib/schematic/credits/types/update_credit_spend_policy_request_body.rb +2 -2
  44. data/lib/schematic/dataexports/client.rb +36 -6
  45. data/lib/schematic/entitlements/client.rb +244 -28
  46. data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +4 -2
  47. data/lib/schematic/entitlements/types/create_company_override_request_body.rb +3 -1
  48. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +4 -2
  49. data/lib/schematic/entitlements/types/update_company_override_request_body.rb +3 -1
  50. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +4 -2
  51. data/lib/schematic/errors/connection_error.rb +11 -0
  52. data/lib/schematic/errors/response_error.rb +23 -2
  53. data/lib/schematic/events/client.rb +78 -9
  54. data/lib/schematic/features/client.rb +160 -18
  55. data/lib/schematic/features/types/check_and_reserve_flag_request_body.rb +1 -1
  56. data/lib/schematic/features/types/create_billing_linked_feature_request_body.rb +2 -0
  57. data/lib/schematic/features/types/create_feature_request_body.rb +2 -0
  58. data/lib/schematic/features/types/update_feature_request_body.rb +2 -0
  59. data/lib/schematic/insights/client.rb +48 -6
  60. data/lib/schematic/integrationsapi/client.rb +120 -14
  61. data/lib/schematic/internal/http/base_request.rb +30 -0
  62. data/lib/schematic/internal/http/raw_client.rb +35 -5
  63. data/lib/schematic/internal/iterators/cursor_item_iterator.rb +7 -2
  64. data/lib/schematic/internal/iterators/cursor_page_iterator.rb +68 -14
  65. data/lib/schematic/internal/iterators/item_iterator.rb +61 -15
  66. data/lib/schematic/internal/iterators/offset_item_iterator.rb +7 -2
  67. data/lib/schematic/internal/iterators/offset_page_iterator.rb +57 -9
  68. data/lib/schematic/internal/json/request.rb +11 -2
  69. data/lib/schematic/internal/multipart/multipart_request.rb +1 -0
  70. data/lib/schematic/internal/types/model.rb +7 -3
  71. data/lib/schematic/internal/types/utils.rb +7 -0
  72. data/lib/schematic/licenses/client.rb +26 -3
  73. data/lib/schematic/planbundle/client.rb +27 -3
  74. data/lib/schematic/plangroups/client.rb +26 -3
  75. data/lib/schematic/planmigrations/client.rb +98 -11
  76. data/lib/schematic/plans/client.rb +213 -23
  77. data/lib/schematic/plans/types/get_plan_version_diff_params.rb +12 -0
  78. data/lib/schematic/plans/types/get_plan_version_diff_request.rb +13 -0
  79. data/lib/schematic/plans/types/get_plan_version_diff_response.rb +13 -0
  80. data/lib/schematic/plans/types/publish_plan_version_request_body.rb +2 -0
  81. data/lib/schematic/rules_engine.rb +14 -2
  82. data/lib/schematic/scheduledcheckout/client.rb +35 -4
  83. data/lib/schematic/schematic_client.rb +22 -11
  84. data/lib/schematic/types/billing_coupon_response_data.rb +2 -2
  85. data/lib/schematic/types/billing_credit_grant_response_data.rb +8 -8
  86. data/lib/schematic/types/billing_customer_subscription.rb +1 -1
  87. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +1 -1
  88. data/lib/schematic/types/billing_price_response_data.rb +1 -1
  89. data/lib/schematic/types/billing_price_view.rb +1 -1
  90. data/lib/schematic/types/billing_product_detail_response_data.rb +2 -2
  91. data/lib/schematic/types/billing_product_for_subscription_response_data.rb +2 -2
  92. data/lib/schematic/types/billing_product_price_response_data.rb +1 -1
  93. data/lib/schematic/types/billing_product_pricing.rb +1 -1
  94. data/lib/schematic/types/billing_product_response_data.rb +2 -2
  95. data/lib/schematic/types/billing_settings_response_data.rb +9 -0
  96. data/lib/schematic/types/billing_subscription_discount_view.rb +2 -2
  97. data/lib/schematic/types/billing_subscription_response_data.rb +1 -1
  98. data/lib/schematic/types/billing_subscription_view.rb +1 -1
  99. data/lib/schematic/types/catalog_config_ordered_plan.rb +2 -0
  100. data/lib/schematic/types/catalog_config_ordered_plan_response_data.rb +2 -0
  101. data/lib/schematic/types/catalog_config_plan_credit.rb +11 -0
  102. data/lib/schematic/types/catalog_config_plan_credit_response_data.rb +11 -0
  103. data/lib/schematic/types/change_subscription_internal_request_body.rb +1 -1
  104. data/lib/schematic/types/change_subscription_request_body.rb +1 -1
  105. data/lib/schematic/types/checkout_problem_code.rb +54 -0
  106. data/lib/schematic/types/checkout_problem_response_data.rb +31 -0
  107. data/lib/schematic/types/checkout_problem_source.rb +13 -0
  108. data/lib/schematic/types/checkout_subscription.rb +1 -1
  109. data/lib/schematic/types/company_billing_entity_subscription_response_data.rb +1 -1
  110. data/lib/schematic/types/company_credit_balance.rb +3 -3
  111. data/lib/schematic/types/company_credit_balance_response_data.rb +4 -4
  112. data/lib/schematic/types/company_detail_response_data.rb +1 -1
  113. data/lib/schematic/types/company_override_response_data.rb +3 -1
  114. data/lib/schematic/types/company_plan_credit_grant_view.rb +1 -1
  115. data/lib/schematic/types/company_plan_detail_response_data.rb +2 -0
  116. data/lib/schematic/types/company_subscription_response_data.rb +1 -1
  117. data/lib/schematic/types/company_user_usage_response_data.rb +2 -2
  118. data/lib/schematic/types/company_user_usage_row_response_data.rb +2 -2
  119. data/lib/schematic/types/component_response_data.rb +1 -1
  120. data/lib/schematic/types/condition.rb +3 -1
  121. data/lib/schematic/types/condition_response_data.rb +3 -1
  122. data/lib/schematic/types/condition_view.rb +3 -1
  123. data/lib/schematic/types/coupon_request_body.rb +2 -2
  124. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +1 -1
  125. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +4 -2
  126. data/lib/schematic/types/create_entitlement_req_common.rb +3 -1
  127. data/lib/schematic/types/create_or_update_condition_request_body.rb +1 -1
  128. data/lib/schematic/types/credit_balance_event_response_data.rb +21 -0
  129. data/lib/schematic/types/credit_balance_feature_consumption_response_data.rb +13 -0
  130. data/lib/schematic/types/credit_balance_point_response_data.rb +15 -0
  131. data/lib/schematic/types/credit_balance_time_series_response_data.rb +15 -0
  132. data/lib/schematic/types/credit_bundle_currency_price.rb +1 -1
  133. data/lib/schematic/types/credit_bundle_currency_price_request_body.rb +1 -1
  134. data/lib/schematic/types/credit_bundle_currency_price_response_data.rb +1 -1
  135. data/lib/schematic/types/credit_burn_breakdown_line.rb +15 -0
  136. data/lib/schematic/types/credit_company_grant_view.rb +8 -8
  137. data/lib/schematic/types/credit_currency_price.rb +1 -1
  138. data/lib/schematic/types/credit_currency_price_request_body.rb +1 -1
  139. data/lib/schematic/types/credit_currency_price_response_data.rb +1 -1
  140. data/lib/schematic/types/credit_event_ledger_response_data.rb +10 -6
  141. data/lib/schematic/types/credit_grant_detail.rb +1 -1
  142. data/lib/schematic/types/credit_lease_response_data.rb +2 -2
  143. data/lib/schematic/types/credit_reservation_response_data.rb +2 -2
  144. data/lib/schematic/types/credit_spend_policy.rb +2 -2
  145. data/lib/schematic/types/credit_spend_policy_response_data.rb +4 -4
  146. data/lib/schematic/types/credit_transfer_response_data.rb +1 -1
  147. data/lib/schematic/types/credit_transfer_view.rb +1 -1
  148. data/lib/schematic/types/credit_usage.rb +5 -5
  149. data/lib/schematic/types/credit_usage_aggregation.rb +4 -4
  150. data/lib/schematic/types/credit_usage_reason.rb +1 -0
  151. data/lib/schematic/types/credits_in_plan.rb +11 -0
  152. data/lib/schematic/types/currency.rb +144 -0
  153. data/lib/schematic/types/currency_price_request_body.rb +1 -1
  154. data/lib/schematic/types/custom_plan_billing_response_data.rb +6 -0
  155. data/lib/schematic/types/entitlement_currency_prices_response_data.rb +1 -1
  156. data/lib/schematic/types/estimated_plan_total.rb +1 -1
  157. data/lib/schematic/types/feature_company_response_data.rb +7 -7
  158. data/lib/schematic/types/feature_detail_response_data.rb +2 -0
  159. data/lib/schematic/types/feature_entitlement.rb +8 -6
  160. data/lib/schematic/types/feature_event_source.rb +12 -0
  161. data/lib/schematic/types/feature_in_plan_response_data.rb +2 -0
  162. data/lib/schematic/types/feature_response_data.rb +2 -0
  163. data/lib/schematic/types/feature_usage_response_data.rb +7 -7
  164. data/lib/schematic/types/feature_view.rb +2 -0
  165. data/lib/schematic/types/flag_check_reservation_response_data.rb +3 -3
  166. data/lib/schematic/types/insights_summary_response_data.rb +1 -1
  167. data/lib/schematic/types/invoice_request_body.rb +1 -1
  168. data/lib/schematic/types/invoice_response_data.rb +1 -1
  169. data/lib/schematic/types/manage_plan_preview_response_response_data.rb +2 -0
  170. data/lib/schematic/types/manage_plan_request.rb +3 -1
  171. data/lib/schematic/types/manage_plan_response_response_data.rb +4 -0
  172. data/lib/schematic/types/mrr_response_data.rb +1 -1
  173. data/lib/schematic/types/onboarding_milestone_view.rb +1 -1
  174. data/lib/schematic/types/ordered_plans_in_group.rb +2 -0
  175. data/lib/schematic/types/plan_billing_source.rb +1 -0
  176. data/lib/schematic/types/plan_change_action.rb +1 -0
  177. data/lib/schematic/types/plan_change_amendment_status.rb +15 -0
  178. data/lib/schematic/types/plan_change_response_data.rb +4 -0
  179. data/lib/schematic/types/plan_credit_grant_view.rb +1 -1
  180. data/lib/schematic/types/plan_credit_order.rb +11 -0
  181. data/lib/schematic/types/plan_credit_visibility.rb +11 -0
  182. data/lib/schematic/types/plan_currency_price_request_body.rb +1 -1
  183. data/lib/schematic/types/plan_currency_prices_response_data.rb +1 -1
  184. data/lib/schematic/types/plan_entitlement_response_data.rb +3 -1
  185. data/lib/schematic/types/plan_group_plan_entitlements_order.rb +2 -0
  186. data/lib/schematic/types/plan_version_billing_product_change_response_data.rb +11 -0
  187. data/lib/schematic/types/plan_version_credit_grant_change_response_data.rb +17 -0
  188. data/lib/schematic/types/plan_version_diff_change_type.rb +13 -0
  189. data/lib/schematic/types/plan_version_diff_price_cadence.rb +14 -0
  190. data/lib/schematic/types/plan_version_diff_response_data.rb +23 -0
  191. data/lib/schematic/types/plan_version_entitlement_change_response_data.rb +17 -0
  192. data/lib/schematic/types/plan_version_field_change_response_data.rb +13 -0
  193. data/lib/schematic/types/plan_version_price_change_response_data.rb +15 -0
  194. data/lib/schematic/types/plan_view_public_response_data.rb +2 -0
  195. data/lib/schematic/types/preflight_request_body.rb +1 -1
  196. data/lib/schematic/types/preview_subscription_change_response_data.rb +3 -1
  197. data/lib/schematic/types/preview_subscription_discount_response_data.rb +2 -2
  198. data/lib/schematic/types/preview_subscription_finance_response_data.rb +2 -2
  199. data/lib/schematic/types/rulesengine_company.rb +1 -1
  200. data/lib/schematic/types/rulesengine_condition.rb +3 -1
  201. data/lib/schematic/types/rulesengine_credit_postpaid_config.rb +1 -1
  202. data/lib/schematic/types/rulesengine_credit_spend_policy.rb +2 -2
  203. data/lib/schematic/types/rulesengine_feature_entitlement.rb +8 -6
  204. data/lib/schematic/types/scheduled_downgrade_response_data.rb +1 -1
  205. data/lib/schematic/types/top_feature_by_usage_response_data.rb +1 -1
  206. data/lib/schematic/types/upcoming_invoice_response_data.rb +1 -1
  207. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +1 -1
  208. data/lib/schematic/types/update_entitlement_req_common.rb +3 -1
  209. data/lib/schematic/types/upsert_billing_product_request_body.rb +1 -1
  210. data/lib/schematic/types/usage_based_entitlement_request_body.rb +1 -1
  211. data/lib/schematic/types/usage_based_entitlement_response_data.rb +1 -1
  212. data/lib/schematic/types/user_credit_usage_response_data.rb +2 -2
  213. data/lib/schematic/types/user_daily_credit_point_response_data.rb +1 -1
  214. data/lib/schematic/types/user_feature_usage_response_data.rb +1 -1
  215. data/lib/schematic/version.rb +1 -1
  216. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  217. data/lib/schematic/webhooks/client.rb +88 -10
  218. data/lib/schematic.rb +38 -3
  219. data/reference.md +340 -44
  220. metadata +37 -2
@@ -49,7 +49,15 @@ module Schematic
49
49
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpdateCompanyPlansResponse.load(response.body))
50
50
  else
51
51
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
52
- raise error_class.new(response.body, code: code)
52
+ error_types = {
53
+ 400 => Schematic::Types::ApiError,
54
+ 401 => Schematic::Types::ApiError,
55
+ 403 => Schematic::Types::ApiError,
56
+ 404 => Schematic::Types::ApiError,
57
+ 500 => Schematic::Types::ApiError
58
+ }
59
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
60
+ raise error_class.new(response.body, code: code, body: error_body)
53
61
  end
54
62
  end
55
63
 
@@ -72,7 +80,7 @@ module Schematic
72
80
  # client.plans.list_custom_plan_billings(
73
81
  # company_id: "company_id",
74
82
  # plan_id: "plan_id",
75
- # plan_billing_source: "custom_plan",
83
+ # plan_billing_source: "amendment",
76
84
  # status: "active",
77
85
  # statuses: ["active"],
78
86
  # limit: 1000000,
@@ -108,7 +116,15 @@ module Schematic
108
116
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListCustomPlanBillingsResponse.load(response.body))
109
117
  else
110
118
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
111
- raise error_class.new(response.body, code: code)
119
+ error_types = {
120
+ 400 => Schematic::Types::ApiError,
121
+ 401 => Schematic::Types::ApiError,
122
+ 403 => Schematic::Types::ApiError,
123
+ 404 => Schematic::Types::ApiError,
124
+ 500 => Schematic::Types::ApiError
125
+ }
126
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
127
+ raise error_class.new(response.body, code: code, body: error_body)
112
128
  end
113
129
  end
114
130
 
@@ -132,14 +148,11 @@ module Schematic
132
148
  # @return [Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse]
133
149
  def mark_custom_plan_billing_paid(request_options: {}, **params)
134
150
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
135
- path_param_names = %i[custom_plan_billing_id]
136
- body_params = params.except(*path_param_names)
137
-
138
151
  request = Schematic::Internal::JSON::Request.new(
139
152
  base_url: request_options[:base_url],
140
153
  method: "PUT",
141
154
  path: "custom-plan-billings/#{URI.encode_uri_component(params[:custom_plan_billing_id].to_s)}/mark-paid",
142
- body: body_params,
155
+ body: params[:request],
143
156
  request_options: request_options
144
157
  )
145
158
  begin
@@ -152,7 +165,15 @@ module Schematic
152
165
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse.load(response.body))
153
166
  else
154
167
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
155
- raise error_class.new(response.body, code: code)
168
+ error_types = {
169
+ 400 => Schematic::Types::ApiError,
170
+ 401 => Schematic::Types::ApiError,
171
+ 403 => Schematic::Types::ApiError,
172
+ 404 => Schematic::Types::ApiError,
173
+ 500 => Schematic::Types::ApiError
174
+ }
175
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
176
+ raise error_class.new(response.body, code: code, body: error_body)
156
177
  end
157
178
  end
158
179
 
@@ -195,7 +216,15 @@ module Schematic
195
216
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::RetryCustomPlanBillingResponse.load(response.body))
196
217
  else
197
218
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
198
- raise error_class.new(response.body, code: code)
219
+ error_types = {
220
+ 400 => Schematic::Types::ApiError,
221
+ 401 => Schematic::Types::ApiError,
222
+ 403 => Schematic::Types::ApiError,
223
+ 404 => Schematic::Types::ApiError,
224
+ 500 => Schematic::Types::ApiError
225
+ }
226
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
227
+ raise error_class.new(response.body, code: code, body: error_body)
199
228
  end
200
229
  end
201
230
 
@@ -233,7 +262,15 @@ module Schematic
233
262
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CreateCustomPlanResponse.load(response.body))
234
263
  else
235
264
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
236
- raise error_class.new(response.body, code: code)
265
+ error_types = {
266
+ 400 => Schematic::Types::ApiError,
267
+ 401 => Schematic::Types::ApiError,
268
+ 403 => Schematic::Types::ApiError,
269
+ 404 => Schematic::Types::ApiError,
270
+ 500 => Schematic::Types::ApiError
271
+ }
272
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
273
+ raise error_class.new(response.body, code: code, body: error_body)
237
274
  end
238
275
  end
239
276
 
@@ -331,7 +368,15 @@ module Schematic
331
368
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListPlansResponse.load(response.body))
332
369
  else
333
370
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
334
- raise error_class.new(response.body, code: code)
371
+ error_types = {
372
+ 400 => Schematic::Types::ApiError,
373
+ 401 => Schematic::Types::ApiError,
374
+ 403 => Schematic::Types::ApiError,
375
+ 404 => Schematic::Types::ApiError,
376
+ 500 => Schematic::Types::ApiError
377
+ }
378
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
379
+ raise error_class.new(response.body, code: code, body: error_body)
335
380
  end
336
381
  end
337
382
 
@@ -369,7 +414,15 @@ module Schematic
369
414
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CreatePlanResponse.load(response.body))
370
415
  else
371
416
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
372
- raise error_class.new(response.body, code: code)
417
+ error_types = {
418
+ 400 => Schematic::Types::ApiError,
419
+ 401 => Schematic::Types::ApiError,
420
+ 403 => Schematic::Types::ApiError,
421
+ 404 => Schematic::Types::ApiError,
422
+ 500 => Schematic::Types::ApiError
423
+ }
424
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
425
+ raise error_class.new(response.body, code: code, body: error_body)
373
426
  end
374
427
  end
375
428
 
@@ -412,7 +465,14 @@ module Schematic
412
465
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::GetPlanResponse.load(response.body))
413
466
  else
414
467
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
415
- raise error_class.new(response.body, code: code)
468
+ error_types = {
469
+ 401 => Schematic::Types::ApiError,
470
+ 403 => Schematic::Types::ApiError,
471
+ 404 => Schematic::Types::ApiError,
472
+ 500 => Schematic::Types::ApiError
473
+ }
474
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
475
+ raise error_class.new(response.body, code: code, body: error_body)
416
476
  end
417
477
  end
418
478
 
@@ -454,7 +514,15 @@ module Schematic
454
514
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpdatePlanResponse.load(response.body))
455
515
  else
456
516
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
457
- raise error_class.new(response.body, code: code)
517
+ error_types = {
518
+ 400 => Schematic::Types::ApiError,
519
+ 401 => Schematic::Types::ApiError,
520
+ 403 => Schematic::Types::ApiError,
521
+ 404 => Schematic::Types::ApiError,
522
+ 500 => Schematic::Types::ApiError
523
+ }
524
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
525
+ raise error_class.new(response.body, code: code, body: error_body)
458
526
  end
459
527
  end
460
528
 
@@ -489,7 +557,15 @@ module Schematic
489
557
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::DeletePlanResponse.load(response.body))
490
558
  else
491
559
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
492
- raise error_class.new(response.body, code: code)
560
+ error_types = {
561
+ 400 => Schematic::Types::ApiError,
562
+ 401 => Schematic::Types::ApiError,
563
+ 403 => Schematic::Types::ApiError,
564
+ 404 => Schematic::Types::ApiError,
565
+ 500 => Schematic::Types::ApiError
566
+ }
567
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
568
+ raise error_class.new(response.body, code: code, body: error_body)
493
569
  end
494
570
  end
495
571
 
@@ -532,7 +608,15 @@ module Schematic
532
608
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpsertBillingProductPlanResponse.load(response.body))
533
609
  else
534
610
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
535
- raise error_class.new(response.body, code: code)
611
+ error_types = {
612
+ 400 => Schematic::Types::ApiError,
613
+ 401 => Schematic::Types::ApiError,
614
+ 403 => Schematic::Types::ApiError,
615
+ 404 => Schematic::Types::ApiError,
616
+ 500 => Schematic::Types::ApiError
617
+ }
618
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
619
+ raise error_class.new(response.body, code: code, body: error_body)
536
620
  end
537
621
  end
538
622
 
@@ -572,7 +656,15 @@ module Schematic
572
656
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpsertPlanForBillingProductResponse.load(response.body))
573
657
  else
574
658
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
575
- raise error_class.new(response.body, code: code)
659
+ error_types = {
660
+ 400 => Schematic::Types::ApiError,
661
+ 401 => Schematic::Types::ApiError,
662
+ 403 => Schematic::Types::ApiError,
663
+ 404 => Schematic::Types::ApiError,
664
+ 500 => Schematic::Types::ApiError
665
+ }
666
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
667
+ raise error_class.new(response.body, code: code, body: error_body)
576
668
  end
577
669
  end
578
670
 
@@ -622,7 +714,15 @@ module Schematic
622
714
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse.load(response.body))
623
715
  else
624
716
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
625
- raise error_class.new(response.body, code: code)
717
+ error_types = {
718
+ 400 => Schematic::Types::ApiError,
719
+ 401 => Schematic::Types::ApiError,
720
+ 403 => Schematic::Types::ApiError,
721
+ 404 => Schematic::Types::ApiError,
722
+ 500 => Schematic::Types::ApiError
723
+ }
724
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
725
+ raise error_class.new(response.body, code: code, body: error_body)
626
726
  end
627
727
  end
628
728
 
@@ -672,7 +772,15 @@ module Schematic
672
772
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse.load(response.body))
673
773
  else
674
774
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
675
- raise error_class.new(response.body, code: code)
775
+ error_types = {
776
+ 400 => Schematic::Types::ApiError,
777
+ 401 => Schematic::Types::ApiError,
778
+ 403 => Schematic::Types::ApiError,
779
+ 404 => Schematic::Types::ApiError,
780
+ 500 => Schematic::Types::ApiError
781
+ }
782
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
783
+ raise error_class.new(response.body, code: code, body: error_body)
676
784
  end
677
785
  end
678
786
 
@@ -770,7 +878,15 @@ module Schematic
770
878
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CountPlansResponse.load(response.body))
771
879
  else
772
880
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
773
- raise error_class.new(response.body, code: code)
881
+ error_types = {
882
+ 400 => Schematic::Types::ApiError,
883
+ 401 => Schematic::Types::ApiError,
884
+ 403 => Schematic::Types::ApiError,
885
+ 404 => Schematic::Types::ApiError,
886
+ 500 => Schematic::Types::ApiError
887
+ }
888
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
889
+ raise error_class.new(response.body, code: code, body: error_body)
774
890
  end
775
891
  end
776
892
 
@@ -814,7 +930,15 @@ module Schematic
814
930
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListPlanIssuesResponse.load(response.body))
815
931
  else
816
932
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
817
- raise error_class.new(response.body, code: code)
933
+ error_types = {
934
+ 400 => Schematic::Types::ApiError,
935
+ 401 => Schematic::Types::ApiError,
936
+ 403 => Schematic::Types::ApiError,
937
+ 404 => Schematic::Types::ApiError,
938
+ 500 => Schematic::Types::ApiError
939
+ }
940
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
941
+ raise error_class.new(response.body, code: code, body: error_body)
818
942
  end
819
943
  end
820
944
 
@@ -857,7 +981,65 @@ module Schematic
857
981
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::DeletePlanVersionResponse.load(response.body))
858
982
  else
859
983
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
860
- raise error_class.new(response.body, code: code)
984
+ error_types = {
985
+ 400 => Schematic::Types::ApiError,
986
+ 401 => Schematic::Types::ApiError,
987
+ 403 => Schematic::Types::ApiError,
988
+ 404 => Schematic::Types::ApiError,
989
+ 500 => Schematic::Types::ApiError
990
+ }
991
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
992
+ raise error_class.new(response.body, code: code, body: error_body)
993
+ end
994
+ end
995
+
996
+ # @param request_options [Hash]
997
+ # @param params [Hash]
998
+ # @option request_options [String] :base_url
999
+ # @option request_options [Hash{String => Object}] :additional_headers
1000
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1001
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1002
+ # @option request_options [Integer] :timeout_in_seconds
1003
+ # @option params [String] :plan_version_id
1004
+ # @option params [String, nil] :against
1005
+ #
1006
+ # @example
1007
+ # client.plans.get_plan_version_diff(
1008
+ # plan_version_id: "plan_version_id",
1009
+ # against: "against"
1010
+ # )
1011
+ #
1012
+ # @return [Schematic::Plans::Types::GetPlanVersionDiffResponse]
1013
+ def get_plan_version_diff(request_options: {}, **params)
1014
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1015
+ query_params = {}
1016
+ query_params["against"] = params[:against] if params.key?(:against)
1017
+
1018
+ request = Schematic::Internal::JSON::Request.new(
1019
+ base_url: request_options[:base_url],
1020
+ method: "GET",
1021
+ path: "plans/version/#{URI.encode_uri_component(params[:plan_version_id].to_s)}/diff",
1022
+ query: query_params,
1023
+ request_options: request_options
1024
+ )
1025
+ begin
1026
+ response = @client.send(request)
1027
+ rescue Net::HTTPRequestTimeout
1028
+ raise Schematic::Errors::TimeoutError
1029
+ end
1030
+ code = response.code.to_i
1031
+ if code.between?(200, 299)
1032
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::GetPlanVersionDiffResponse.load(response.body))
1033
+ else
1034
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1035
+ error_types = {
1036
+ 401 => Schematic::Types::ApiError,
1037
+ 403 => Schematic::Types::ApiError,
1038
+ 404 => Schematic::Types::ApiError,
1039
+ 500 => Schematic::Types::ApiError
1040
+ }
1041
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1042
+ raise error_class.new(response.body, code: code, body: error_body)
861
1043
  end
862
1044
  end
863
1045
 
@@ -901,7 +1083,15 @@ module Schematic
901
1083
  (response.body.to_s.empty? ? nil : Schematic::Plans::Types::PublishPlanVersionResponse.load(response.body))
902
1084
  else
903
1085
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
904
- raise error_class.new(response.body, code: code)
1086
+ error_types = {
1087
+ 400 => Schematic::Types::ApiError,
1088
+ 401 => Schematic::Types::ApiError,
1089
+ 403 => Schematic::Types::ApiError,
1090
+ 404 => Schematic::Types::ApiError,
1091
+ 500 => Schematic::Types::ApiError
1092
+ }
1093
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1094
+ raise error_class.new(response.body, code: code, body: error_body)
905
1095
  end
906
1096
  end
907
1097
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ # Input parameters
7
+ class GetPlanVersionDiffParams < Internal::Types::Model
8
+ field :against, -> { String }, optional: true, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class GetPlanVersionDiffRequest < Internal::Types::Model
7
+ field :plan_version_id, -> { String }, optional: false, nullable: false
8
+
9
+ field :against, -> { String }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Plans
5
+ module Types
6
+ class GetPlanVersionDiffResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::PlanVersionDiffResponseData }, optional: false, nullable: false
8
+
9
+ field :params, -> { Schematic::Plans::Types::GetPlanVersionDiffParams }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -14,6 +14,8 @@ module Schematic
14
14
 
15
15
  field :billing_start_date, -> { String }, optional: true, nullable: false
16
16
 
17
+ field :collection_method, -> { Schematic::Types::BillingCollectionMethod }, optional: true, nullable: false
18
+
17
19
  field :coupon_external_id, -> { String }, optional: true, nullable: false
18
20
 
19
21
  field :custom_field_values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: true, nullable: false
@@ -82,8 +82,20 @@ module Schematic
82
82
  # "would this call still be allowed after it lands".
83
83
  #
84
84
  # options is a hash with any of :credit_cost (credit id to cost),
85
- # :usage, and :event_usage ({ event_subtype:, quantity: }). The engine reads
86
- # them snake_case in both directions, so they go on the envelope as given.
85
+ # :usage, :event_usage ({ event_subtype:, quantity: }), and
86
+ # :event_quantities ({ event_subtype:, quantity:, quantities: }). The engine
87
+ # reads them snake_case in both directions, so they go on the envelope as
88
+ # given.
89
+ #
90
+ # event_quantities prices an event against credit-balance conditions whose
91
+ # event_subtype matches, the way the API burns it: quantity times the
92
+ # condition's consumption_rate, plus each named quantity times its rate in
93
+ # the condition's quantity_rates. For an inference call, quantity is the
94
+ # request count and quantities the token counts as the event reports them
95
+ # (input tokens including the cached and cache-creation subsets). Keys
96
+ # without a rate cost nothing; an absent or zero quantity means one. It
97
+ # ranks below credit_cost and above event_usage and usage, and the engine
98
+ # reads its values as floats, so unlike event_usage they are not rounded.
87
99
  def check_flag_with_options(flag, company = nil, user = nil, options = nil)
88
100
  raise "WASM rules engine not initialized" unless @initialized
89
101
 
@@ -56,7 +56,15 @@ module Schematic
56
56
  (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::ListScheduledCheckoutsResponse.load(response.body))
57
57
  else
58
58
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
59
- raise error_class.new(response.body, code: code)
59
+ error_types = {
60
+ 400 => Schematic::Types::ApiError,
61
+ 401 => Schematic::Types::ApiError,
62
+ 403 => Schematic::Types::ApiError,
63
+ 404 => Schematic::Types::ApiError,
64
+ 500 => Schematic::Types::ApiError
65
+ }
66
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
67
+ raise error_class.new(response.body, code: code, body: error_body)
60
68
  end
61
69
  end
62
70
 
@@ -96,7 +104,15 @@ module Schematic
96
104
  (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::CreateScheduledCheckoutResponse.load(response.body))
97
105
  else
98
106
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
99
- raise error_class.new(response.body, code: code)
107
+ error_types = {
108
+ 400 => Schematic::Types::ApiError,
109
+ 401 => Schematic::Types::ApiError,
110
+ 403 => Schematic::Types::ApiError,
111
+ 404 => Schematic::Types::ApiError,
112
+ 500 => Schematic::Types::ApiError
113
+ }
114
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
115
+ raise error_class.new(response.body, code: code, body: error_body)
100
116
  end
101
117
  end
102
118
 
@@ -131,7 +147,14 @@ module Schematic
131
147
  (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::GetScheduledCheckoutResponse.load(response.body))
132
148
  else
133
149
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
134
- raise error_class.new(response.body, code: code)
150
+ error_types = {
151
+ 401 => Schematic::Types::ApiError,
152
+ 403 => Schematic::Types::ApiError,
153
+ 404 => Schematic::Types::ApiError,
154
+ 500 => Schematic::Types::ApiError
155
+ }
156
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
157
+ raise error_class.new(response.body, code: code, body: error_body)
135
158
  end
136
159
  end
137
160
 
@@ -171,7 +194,15 @@ module Schematic
171
194
  (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::UpdateScheduledCheckoutResponse.load(response.body))
172
195
  else
173
196
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
174
- raise error_class.new(response.body, code: code)
197
+ error_types = {
198
+ 400 => Schematic::Types::ApiError,
199
+ 401 => Schematic::Types::ApiError,
200
+ 403 => Schematic::Types::ApiError,
201
+ 404 => Schematic::Types::ApiError,
202
+ 500 => Schematic::Types::ApiError
203
+ }
204
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
205
+ raise error_class.new(response.body, code: code, body: error_body)
175
206
  end
176
207
  end
177
208
  end
@@ -175,9 +175,8 @@ module Schematic
175
175
 
176
176
  # default_value overrides the registered flag default on every path that
177
177
  # cannot answer from the flag itself: offline, an API error, or a response
178
- # with no value. Leaving it nil keeps the registered default. timeout_ms is
179
- # threaded to the API call, but see the note on check: the generated
180
- # transport does not yet apply a per-request timeout.
178
+ # with no value. Leaving it nil keeps the registered default. timeout_ms
179
+ # bounds each attempt of the API call.
181
180
  def check_flag_with_entitlement(flag_key, company: nil, user: nil, preflight: nil, default_value: nil,
182
181
  timeout_ms: nil)
183
182
  get_default = -> { resolve_default_value(flag_key, default_value) }
@@ -345,10 +344,9 @@ module Schematic
345
344
  # governs that fallback too, so a check that cannot reach the credit path
346
345
  # still answers the way the caller asked.
347
346
  #
348
- # timeout_ms is carried on the API request but not yet applied: the
349
- # generated transport takes its timeout from the construction of its HTTP
350
- # client, and nothing exposes that, so no per-check or client-level timeout
351
- # is configurable today.
347
+ # timeout_ms bounds each attempt of the API calls the check makes (the
348
+ # plain flag check, check-and-reserve, or a lease acquire or extend), and
349
+ # caps how long the check waits on another caller's acquire or extend.
352
350
  def check(flag_key, company: nil, user: nil, usage: nil, event_subtype: nil, on_acquire_failure: nil,
353
351
  default_value: nil, timeout_ms: nil)
354
352
  options = {
@@ -657,6 +655,20 @@ module Schematic
657
655
  # Cache providers that serialize (RedisCacheProvider) hand back a Hash, not
658
656
  # the CheckFlagResponse that was stored; the in-memory cache returns the
659
657
  # object itself. Normalize so callers can use the response API either way.
658
+ # The REST preflight body has no event_quantities yet; only the local
659
+ # engine applies it. Sending it would ask the API a question it cannot
660
+ # read, so it comes off here, and the check answers without it. A preflight
661
+ # left empty becomes nil, so the check is a plain, cacheable one.
662
+ def rest_preflight(flag_key, preflight)
663
+ return preflight unless preflight.is_a?(Hash)
664
+ return preflight unless preflight.key?(:event_quantities) || preflight.key?("event_quantities")
665
+
666
+ @logger.warn("Preflight event_quantities for flag '#{flag_key}' is only applied by local evaluation; " \
667
+ "the API check ignores it, so the check answers without it")
668
+ rest = preflight.reject { |key, _| key.to_s == "event_quantities" }
669
+ rest.empty? ? nil : rest
670
+ end
671
+
660
672
  def coerce_cached_response(cached)
661
673
  return cached unless cached.is_a?(Hash)
662
674
 
@@ -665,6 +677,7 @@ module Schematic
665
677
 
666
678
  def check_flag_via_api(flag_key, company, user, preflight: nil, timeout_ms: nil, get_default: nil)
667
679
  get_default ||= -> { get_flag_default(flag_key) }
680
+ preflight = rest_preflight(flag_key, preflight)
668
681
  cache_key = build_cache_key(flag_key, company, user)
669
682
  # The cache is keyed by flag, company and user, so a preflighted check and
670
683
  # a plain one collide on one entry while asking different questions ("is
@@ -736,10 +749,8 @@ module Schematic
736
749
  end
737
750
  end
738
751
 
739
- # The generated transport reads its timeout from its own construction, not
740
- # from a request, so timeout_in_seconds is carried but not yet honored.
741
- # Sending it anyway means a per-check timeout starts working the moment the
742
- # transport does, without another change here.
752
+ # The generated transport reads timeout_in_seconds per request, falling
753
+ # back to its client-wide timeout when the key is absent.
743
754
  def api_request_options(timeout_ms)
744
755
  return {} if timeout_ms.nil?
745
756
 
@@ -7,7 +7,7 @@ module Schematic
7
7
 
8
8
  field :amount_off, -> { Integer }, optional: true, nullable: false
9
9
 
10
- field :currency, -> { String }, optional: true, nullable: false
10
+ field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
11
11
 
12
12
  field :duration, -> { String }, optional: true, nullable: false
13
13
 
@@ -27,7 +27,7 @@ module Schematic
27
27
 
28
28
  field :name, -> { String }, optional: false, nullable: false
29
29
 
30
- field :percent_off, -> { Integer }, optional: true, nullable: false
30
+ field :percent_off, -> { Float }, optional: true, nullable: false
31
31
 
32
32
  field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
33
33
 
@@ -19,7 +19,7 @@ module Schematic
19
19
 
20
20
  field :credit_name, -> { String }, optional: false, nullable: false
21
21
 
22
- field :currency, -> { String }, optional: true, nullable: false
22
+ field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
23
23
 
24
24
  field :expires_at, -> { String }, optional: true, nullable: false
25
25
 
@@ -35,25 +35,25 @@ module Schematic
35
35
 
36
36
  field :postpaid_charge_amount, -> { Integer }, optional: true, nullable: false
37
37
 
38
- field :postpaid_charge_currency, -> { String }, optional: true, nullable: false
38
+ field :postpaid_charge_currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
39
39
 
40
- field :postpaid_charged_credits, -> { Integer }, optional: true, nullable: false
40
+ field :postpaid_charged_credits, -> { Float }, optional: true, nullable: false
41
41
 
42
42
  field :price, -> { Schematic::Types::BillingPriceResponseData }, optional: true, nullable: false
43
43
 
44
- field :quantity, -> { Integer }, optional: false, nullable: false
44
+ field :quantity, -> { Float }, optional: false, nullable: false
45
45
 
46
- field :quantity_remaining, -> { Integer }, optional: false, nullable: false
46
+ field :quantity_remaining, -> { Float }, optional: false, nullable: false
47
47
 
48
- field :quantity_used, -> { Integer }, optional: false, nullable: false
48
+ field :quantity_used, -> { Float }, optional: false, nullable: false
49
49
 
50
50
  field :renewal_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
51
51
 
52
52
  field :renewal_period, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
53
53
 
54
- field :reserved, -> { Integer }, optional: true, nullable: false
54
+ field :reserved, -> { Float }, optional: true, nullable: false
55
55
 
56
- field :settled, -> { Integer }, optional: true, nullable: false
56
+ field :settled, -> { Float }, optional: true, nullable: false
57
57
 
58
58
  field :source_grant_id, -> { String }, optional: true, nullable: false
59
59
 
@@ -3,7 +3,7 @@
3
3
  module Schematic
4
4
  module Types
5
5
  class BillingCustomerSubscription < Internal::Types::Model
6
- field :currency, -> { String }, optional: false, nullable: false
6
+ field :currency, -> { Schematic::Types::Currency }, optional: false, nullable: false
7
7
 
8
8
  field :expired_at, -> { String }, optional: true, nullable: false
9
9
 
@@ -57,7 +57,7 @@ module Schematic
57
57
 
58
58
  field :license_id, -> { String }, optional: true, nullable: false
59
59
 
60
- field :overdraft_limit, -> { Integer }, optional: true, nullable: false
60
+ field :overdraft_limit, -> { Float }, optional: true, nullable: false
61
61
 
62
62
  field :plan, -> { Schematic::Types::PreviewObjectResponseData }, optional: true, nullable: false
63
63