schematichq 1.4.3 → 1.4.5

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/.fern/replay.lock +501 -2
  4. data/WASM_VERSION +1 -1
  5. data/lib/schematic/accounts/client.rb +44 -0
  6. data/lib/schematic/accounts/types/count_account_members_params.rb +15 -0
  7. data/lib/schematic/accounts/types/count_account_members_request.rb +14 -0
  8. data/lib/schematic/accounts/types/count_account_members_response.rb +12 -0
  9. data/lib/schematic/client.rb +1 -1
  10. data/lib/schematic/credits/client.rb +0 -104
  11. data/lib/schematic/integrationsapi/client.rb +99 -3
  12. data/lib/schematic/integrationsapi/types/assume_stripe_installed_response.rb +12 -0
  13. data/lib/schematic/integrationsapi/types/install_integration_response.rb +12 -0
  14. data/lib/schematic/integrationsapi/types/install_stripe_response.rb +12 -0
  15. data/lib/schematic/integrationsapi/types/{load_sample_data_set_v_2_response.rb → load_sample_data_set_response.rb} +1 -1
  16. data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +4 -0
  17. data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +4 -0
  18. data/lib/schematic/plans/types/publish_plan_version_request_body.rb +0 -1
  19. data/lib/schematic/plans/types/retry_custom_plan_billing_request_body.rb +0 -1
  20. data/lib/schematic/types/account_member_response_data.rb +2 -0
  21. data/lib/schematic/types/billing_credit_grant_reason.rb +1 -0
  22. data/lib/schematic/types/billing_credit_grant_response_data.rb +3 -0
  23. data/lib/schematic/types/billing_credit_grant_zeroed_out_reason.rb +1 -0
  24. data/lib/schematic/types/billing_credit_ledger_authority.rb +13 -0
  25. data/lib/schematic/types/billing_credit_view.rb +1 -0
  26. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +1 -0
  27. data/lib/schematic/types/billing_provider_type.rb +1 -0
  28. data/lib/schematic/types/change_subscription_internal_request_body.rb +2 -0
  29. data/lib/schematic/types/change_subscription_request_body.rb +2 -0
  30. data/lib/schematic/types/checkout_data_response_data.rb +1 -0
  31. data/lib/schematic/types/checkout_field_input.rb +14 -0
  32. data/lib/schematic/types/checkout_field_response_data.rb +18 -0
  33. data/lib/schematic/types/checkout_field_value.rb +10 -0
  34. data/lib/schematic/types/checkout_field_with_value.rb +15 -0
  35. data/lib/schematic/types/checkout_settings_response_data.rb +3 -0
  36. data/lib/schematic/types/company_credit_balance_response_data.rb +2 -0
  37. data/lib/schematic/types/company_plan_credit_grant_view.rb +1 -0
  38. data/lib/schematic/types/component_hydrate_response_data.rb +1 -0
  39. data/lib/schematic/types/component_preview_response_data.rb +1 -0
  40. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +1 -0
  41. data/lib/schematic/types/credit_company_grant_view.rb +3 -0
  42. data/lib/schematic/types/credit_event_ledger_response_data.rb +1 -0
  43. data/lib/schematic/types/credit_usage_reason.rb +15 -0
  44. data/lib/schematic/types/event_detail_response_data.rb +1 -0
  45. data/lib/schematic/types/event_response_data.rb +1 -0
  46. data/lib/schematic/types/feature_entitlement.rb +2 -0
  47. data/lib/schematic/types/install_integration_request_body.rb +14 -0
  48. data/lib/schematic/types/integration_config.rb +1 -0
  49. data/lib/schematic/types/integration_install_config.rb +18 -0
  50. data/lib/schematic/types/integration_install_response_data.rb +11 -0
  51. data/lib/schematic/types/integration_type.rb +1 -0
  52. data/lib/schematic/types/manage_plan_request.rb +1 -0
  53. data/lib/schematic/types/metronome_integration_config.rb +7 -0
  54. data/lib/schematic/types/migration_error_code.rb +1 -0
  55. data/lib/schematic/types/plan_change_response_data.rb +1 -0
  56. data/lib/schematic/types/plan_credit_grant_view.rb +1 -0
  57. data/lib/schematic/types/plan_group_detail_response_data.rb +1 -0
  58. data/lib/schematic/types/preview_subscription_change_response_data.rb +3 -0
  59. data/lib/schematic/types/rulesengine_feature_entitlement.rb +2 -0
  60. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +1 -0
  61. data/lib/schematic/version.rb +1 -1
  62. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  63. data/lib/schematic.rb +23 -15
  64. data/reference.md +386 -293
  65. metadata +19 -11
  66. data/lib/schematic/credits/types/count_credit_ledger_params.rb +0 -19
  67. data/lib/schematic/credits/types/count_credit_ledger_request.rb +0 -18
  68. data/lib/schematic/credits/types/count_credit_ledger_response.rb +0 -12
  69. data/lib/schematic/credits/types/get_enriched_credit_ledger_params.rb +0 -19
  70. data/lib/schematic/credits/types/get_enriched_credit_ledger_request.rb +0 -18
  71. data/lib/schematic/credits/types/get_enriched_credit_ledger_response.rb +0 -12
  72. data/lib/schematic/types/credit_ledger_enriched_entry_response_data.rb +0 -30
  73. data/lib/schematic/types/credit_ledger_period.rb +0 -14
@@ -849,110 +849,6 @@ module Schematic
849
849
  end
850
850
  end
851
851
 
852
- # @param request_options [Hash]
853
- # @param params [Hash]
854
- # @option request_options [String] :base_url
855
- # @option request_options [Hash{String => Object}] :additional_headers
856
- # @option request_options [Hash{String => Object}] :additional_query_parameters
857
- # @option request_options [Hash{String => Object}] :additional_body_parameters
858
- # @option request_options [Integer] :timeout_in_seconds
859
- # @option params [String] :company_id
860
- # @option params [String, nil] :billing_credit_id
861
- # @option params [String, nil] :feature_id
862
- # @option params [Schematic::Types::CreditLedgerPeriod] :period
863
- # @option params [String, nil] :start_time
864
- # @option params [String, nil] :end_time
865
- # @option params [Integer, nil] :limit
866
- # @option params [Integer, nil] :offset
867
- #
868
- # @return [Schematic::Credits::Types::GetEnrichedCreditLedgerResponse]
869
- def get_enriched_credit_ledger(request_options: {}, **params)
870
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
871
- query_param_names = %i[company_id billing_credit_id feature_id period start_time end_time limit offset]
872
- query_params = {}
873
- query_params["company_id"] = params[:company_id] if params.key?(:company_id)
874
- query_params["billing_credit_id"] = params[:billing_credit_id] if params.key?(:billing_credit_id)
875
- query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id)
876
- query_params["period"] = params[:period] if params.key?(:period)
877
- query_params["start_time"] = params[:start_time] if params.key?(:start_time)
878
- query_params["end_time"] = params[:end_time] if params.key?(:end_time)
879
- query_params["limit"] = params[:limit] if params.key?(:limit)
880
- query_params["offset"] = params[:offset] if params.key?(:offset)
881
- params.except(*query_param_names)
882
-
883
- request = Schematic::Internal::JSON::Request.new(
884
- base_url: request_options[:base_url],
885
- method: "GET",
886
- path: "billing/credits/ledger",
887
- query: query_params,
888
- request_options: request_options
889
- )
890
- begin
891
- response = @client.send(request)
892
- rescue Net::HTTPRequestTimeout
893
- raise Schematic::Errors::TimeoutError
894
- end
895
- code = response.code.to_i
896
- if code.between?(200, 299)
897
- Schematic::Credits::Types::GetEnrichedCreditLedgerResponse.load(response.body)
898
- else
899
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
900
- raise error_class.new(response.body, code: code)
901
- end
902
- end
903
-
904
- # @param request_options [Hash]
905
- # @param params [Hash]
906
- # @option request_options [String] :base_url
907
- # @option request_options [Hash{String => Object}] :additional_headers
908
- # @option request_options [Hash{String => Object}] :additional_query_parameters
909
- # @option request_options [Hash{String => Object}] :additional_body_parameters
910
- # @option request_options [Integer] :timeout_in_seconds
911
- # @option params [String] :company_id
912
- # @option params [String, nil] :billing_credit_id
913
- # @option params [String, nil] :feature_id
914
- # @option params [Schematic::Types::CreditLedgerPeriod] :period
915
- # @option params [String, nil] :start_time
916
- # @option params [String, nil] :end_time
917
- # @option params [Integer, nil] :limit
918
- # @option params [Integer, nil] :offset
919
- #
920
- # @return [Schematic::Credits::Types::CountCreditLedgerResponse]
921
- def count_credit_ledger(request_options: {}, **params)
922
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
923
- query_param_names = %i[company_id billing_credit_id feature_id period start_time end_time limit offset]
924
- query_params = {}
925
- query_params["company_id"] = params[:company_id] if params.key?(:company_id)
926
- query_params["billing_credit_id"] = params[:billing_credit_id] if params.key?(:billing_credit_id)
927
- query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id)
928
- query_params["period"] = params[:period] if params.key?(:period)
929
- query_params["start_time"] = params[:start_time] if params.key?(:start_time)
930
- query_params["end_time"] = params[:end_time] if params.key?(:end_time)
931
- query_params["limit"] = params[:limit] if params.key?(:limit)
932
- query_params["offset"] = params[:offset] if params.key?(:offset)
933
- params.except(*query_param_names)
934
-
935
- request = Schematic::Internal::JSON::Request.new(
936
- base_url: request_options[:base_url],
937
- method: "GET",
938
- path: "billing/credits/ledger/count",
939
- query: query_params,
940
- request_options: request_options
941
- )
942
- begin
943
- response = @client.send(request)
944
- rescue Net::HTTPRequestTimeout
945
- raise Schematic::Errors::TimeoutError
946
- end
947
- code = response.code.to_i
948
- if code.between?(200, 299)
949
- Schematic::Credits::Types::CountCreditLedgerResponse.load(response.body)
950
- else
951
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
952
- raise error_class.new(response.body, code: code)
953
- end
954
- end
955
-
956
852
  # @param request_options [Hash]
957
853
  # @param params [Hash]
958
854
  # @option request_options [String] :base_url
@@ -124,6 +124,38 @@ module Schematic
124
124
  end
125
125
  end
126
126
 
127
+ # @param request_options [Hash]
128
+ # @param params [Schematic::Types::InstallIntegrationRequestBody]
129
+ # @option request_options [String] :base_url
130
+ # @option request_options [Hash{String => Object}] :additional_headers
131
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
132
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
133
+ # @option request_options [Integer] :timeout_in_seconds
134
+ #
135
+ # @return [Schematic::Integrationsapi::Types::InstallIntegrationResponse]
136
+ def install_integration(request_options: {}, **params)
137
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
138
+ request = Schematic::Internal::JSON::Request.new(
139
+ base_url: request_options[:base_url],
140
+ method: "POST",
141
+ path: "integrations/install",
142
+ body: Schematic::Types::InstallIntegrationRequestBody.new(params).to_h,
143
+ request_options: request_options
144
+ )
145
+ begin
146
+ response = @client.send(request)
147
+ rescue Net::HTTPRequestTimeout
148
+ raise Schematic::Errors::TimeoutError
149
+ end
150
+ code = response.code.to_i
151
+ if code.between?(200, 299)
152
+ Schematic::Integrationsapi::Types::InstallIntegrationResponse.load(response.body)
153
+ else
154
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
155
+ raise error_class.new(response.body, code: code)
156
+ end
157
+ end
158
+
127
159
  # @param request_options [Hash]
128
160
  # @param params [Schematic::Integrationsapi::Types::StartDataImportRequestBody]
129
161
  # @option request_options [String] :base_url
@@ -164,8 +196,8 @@ module Schematic
164
196
  # @option request_options [Hash{String => Object}] :additional_body_parameters
165
197
  # @option request_options [Integer] :timeout_in_seconds
166
198
  #
167
- # @return [Schematic::Integrationsapi::Types::LoadSampleDataSetV2Response]
168
- def load_sample_data_set_v_2(request_options: {}, **params)
199
+ # @return [Schematic::Integrationsapi::Types::LoadSampleDataSetResponse]
200
+ def load_sample_data_set(request_options: {}, **params)
169
201
  Schematic::Internal::Types::Utils.normalize_keys(params)
170
202
  request = Schematic::Internal::JSON::Request.new(
171
203
  base_url: request_options[:base_url],
@@ -180,7 +212,71 @@ module Schematic
180
212
  end
181
213
  code = response.code.to_i
182
214
  if code.between?(200, 299)
183
- Schematic::Integrationsapi::Types::LoadSampleDataSetV2Response.load(response.body)
215
+ Schematic::Integrationsapi::Types::LoadSampleDataSetResponse.load(response.body)
216
+ else
217
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
218
+ raise error_class.new(response.body, code: code)
219
+ end
220
+ end
221
+
222
+ # @param request_options [Hash]
223
+ # @param params [Schematic::Types::InstallIntegrationRequestBody]
224
+ # @option request_options [String] :base_url
225
+ # @option request_options [Hash{String => Object}] :additional_headers
226
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
227
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
228
+ # @option request_options [Integer] :timeout_in_seconds
229
+ #
230
+ # @return [Schematic::Integrationsapi::Types::AssumeStripeInstalledResponse]
231
+ def assume_stripe_installed(request_options: {}, **params)
232
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
233
+ request = Schematic::Internal::JSON::Request.new(
234
+ base_url: request_options[:base_url],
235
+ method: "POST",
236
+ path: "integrations/stripe/v2/assume-installed",
237
+ body: Schematic::Types::InstallIntegrationRequestBody.new(params).to_h,
238
+ request_options: request_options
239
+ )
240
+ begin
241
+ response = @client.send(request)
242
+ rescue Net::HTTPRequestTimeout
243
+ raise Schematic::Errors::TimeoutError
244
+ end
245
+ code = response.code.to_i
246
+ if code.between?(200, 299)
247
+ Schematic::Integrationsapi::Types::AssumeStripeInstalledResponse.load(response.body)
248
+ else
249
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
250
+ raise error_class.new(response.body, code: code)
251
+ end
252
+ end
253
+
254
+ # @param request_options [Hash]
255
+ # @param params [Schematic::Types::InstallIntegrationRequestBody]
256
+ # @option request_options [String] :base_url
257
+ # @option request_options [Hash{String => Object}] :additional_headers
258
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
259
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
260
+ # @option request_options [Integer] :timeout_in_seconds
261
+ #
262
+ # @return [Schematic::Integrationsapi::Types::InstallStripeResponse]
263
+ def install_stripe(request_options: {}, **params)
264
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
265
+ request = Schematic::Internal::JSON::Request.new(
266
+ base_url: request_options[:base_url],
267
+ method: "POST",
268
+ path: "integrations/stripe/v2/install",
269
+ body: Schematic::Types::InstallIntegrationRequestBody.new(params).to_h,
270
+ request_options: request_options
271
+ )
272
+ begin
273
+ response = @client.send(request)
274
+ rescue Net::HTTPRequestTimeout
275
+ raise Schematic::Errors::TimeoutError
276
+ end
277
+ code = response.code.to_i
278
+ if code.between?(200, 299)
279
+ Schematic::Integrationsapi::Types::InstallStripeResponse.load(response.body)
184
280
  else
185
281
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
186
282
  raise error_class.new(response.body, code: code)
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class AssumeStripeInstalledResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::IntegrationInstallResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class InstallIntegrationResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::IntegrationInstallResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class InstallStripeResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::IntegrationInstallResponseData }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -3,7 +3,7 @@
3
3
  module Schematic
4
4
  module Integrationsapi
5
5
  module Types
6
- class LoadSampleDataSetV2Response < Internal::Types::Model
6
+ class LoadSampleDataSetResponse < Internal::Types::Model
7
7
  field :data, -> { Schematic::Types::IntegrationsDataSetResponseData }, optional: false, nullable: false
8
8
  field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
9
  end
@@ -9,12 +9,16 @@ module Schematic
9
9
  field :checkout_collect_address, -> { Internal::Types::Boolean }, optional: false, nullable: false
10
10
  field :checkout_collect_email, -> { Internal::Types::Boolean }, optional: false, nullable: false
11
11
  field :checkout_collect_phone, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
+ field :custom_checkout_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldInput] }, optional: true, nullable: false
12
13
  field :custom_plan_config, -> { Schematic::Types::CustomPlanConfig }, optional: true, nullable: false
13
14
  field :custom_plan_id, -> { String }, optional: true, nullable: false
14
15
  field :enable_tax_collection, -> { Internal::Types::Boolean }, optional: false, nullable: false
15
16
  field :fallback_plan_id, -> { String }, optional: true, nullable: false
16
17
  field :initial_plan_id, -> { String }, optional: true, nullable: false
17
18
  field :initial_plan_price_id, -> { String }, optional: true, nullable: false
19
+ field :opt_in_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
20
+ field :opt_in_text, -> { String }, optional: true, nullable: false
21
+ field :opt_in_title, -> { String }, optional: true, nullable: false
18
22
  field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::OrderedPlansInGroup] }, optional: false, nullable: false
19
23
  field :ordered_bundle_list, -> { Internal::Types::Array[Schematic::Types::PlanGroupBundleOrder] }, optional: false, nullable: false
20
24
  field :ordered_plans, -> { Internal::Types::Array[Schematic::Types::OrderedPlansInGroup] }, optional: false, nullable: false
@@ -10,12 +10,16 @@ module Schematic
10
10
  field :checkout_collect_address, -> { Internal::Types::Boolean }, optional: false, nullable: false
11
11
  field :checkout_collect_email, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
12
  field :checkout_collect_phone, -> { Internal::Types::Boolean }, optional: false, nullable: false
13
+ field :custom_checkout_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldInput] }, optional: true, nullable: false
13
14
  field :custom_plan_config, -> { Schematic::Types::CustomPlanConfig }, optional: true, nullable: false
14
15
  field :custom_plan_id, -> { String }, optional: true, nullable: false
15
16
  field :enable_tax_collection, -> { Internal::Types::Boolean }, optional: false, nullable: false
16
17
  field :fallback_plan_id, -> { String }, optional: true, nullable: false
17
18
  field :initial_plan_id, -> { String }, optional: true, nullable: false
18
19
  field :initial_plan_price_id, -> { String }, optional: true, nullable: false
20
+ field :opt_in_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
21
+ field :opt_in_text, -> { String }, optional: true, nullable: false
22
+ field :opt_in_title, -> { String }, optional: true, nullable: false
19
23
  field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::OrderedPlansInGroup] }, optional: false, nullable: false
20
24
  field :ordered_bundle_list, -> { Internal::Types::Array[Schematic::Types::PlanGroupBundleOrder] }, optional: false, nullable: false
21
25
  field :ordered_plans, -> { Internal::Types::Array[Schematic::Types::OrderedPlansInGroup] }, optional: false, nullable: false
@@ -10,7 +10,6 @@ module Schematic
10
10
  field :days_until_due, -> { Integer }, optional: true, nullable: false
11
11
  field :excluded_company_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
12
12
  field :migration_strategy, -> { Schematic::Types::PlanVersionMigrationStrategy }, optional: false, nullable: false
13
- field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
14
13
  end
15
14
  end
16
15
  end
@@ -8,7 +8,6 @@ module Schematic
8
8
  field :activation_strategy, -> { Schematic::Types::CustomPlanActivationStrategy }, optional: true, nullable: false
9
9
  field :customer_email, -> { String }, optional: false, nullable: false
10
10
  field :days_until_due, -> { Integer }, optional: true, nullable: false
11
- field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
12
11
  end
13
12
  end
14
13
  end
@@ -5,8 +5,10 @@ module Schematic
5
5
  class AccountMemberResponseData < Internal::Types::Model
6
6
  field :created_at, -> { String }, optional: false, nullable: false
7
7
  field :email, -> { String }, optional: true, nullable: false
8
+ field :first_name, -> { String }, optional: true, nullable: false
8
9
  field :id, -> { String }, optional: false, nullable: false
9
10
  field :image_url, -> { String }, optional: true, nullable: false
11
+ field :last_name, -> { String }, optional: true, nullable: false
10
12
  field :name, -> { String }, optional: true, nullable: false
11
13
  field :permissions, -> { Internal::Types::Hash[String, Internal::Types::Array[Schematic::Types::AccountMemberPermission]] }, optional: false, nullable: false
12
14
  field :role, -> { Schematic::Types::AccountMemberRole }, optional: true, nullable: false
@@ -10,6 +10,7 @@ module Schematic
10
10
  FREE = "free"
11
11
  PLAN = "plan"
12
12
  PURCHASED = "purchased"
13
+ ROLLOVER = "rollover"
13
14
  end
14
15
  end
15
16
  end
@@ -21,6 +21,9 @@ module Schematic
21
21
  field :quantity_used, -> { Integer }, optional: false, nullable: false
22
22
  field :renewal_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
23
23
  field :renewal_period, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
24
+ field :reserved, -> { Integer }, optional: true, nullable: false
25
+ field :settled, -> { Integer }, optional: true, nullable: false
26
+ field :source_grant_id, -> { String }, optional: true, nullable: false
24
27
  field :source_label, -> { String }, optional: false, nullable: false
25
28
  field :transfers, -> { Internal::Types::Array[Schematic::Types::CreditTransferResponseData] }, optional: true, nullable: false
26
29
  field :updated_at, -> { String }, optional: false, nullable: false
@@ -9,6 +9,7 @@ module Schematic
9
9
  MANUAL = "manual"
10
10
  PLAN_CHANGE = "plan_change"
11
11
  PLAN_PERIOD_RESET = "plan_period_reset"
12
+ RECONCILED = "reconciled"
12
13
  end
13
14
  end
14
15
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ module BillingCreditLedgerAuthority
6
+ extend Schematic::Internal::Types::Enum
7
+
8
+ SCHEMATIC_AUTHORITATIVE = "schematic_authoritative"
9
+ EXTERNAL_MIRROR = "external_mirror"
10
+ EXTERNAL_RATED = "external_rated"
11
+ end
12
+ end
13
+ end
@@ -15,6 +15,7 @@ module Schematic
15
15
  field :environment_id, -> { String }, optional: false, nullable: false
16
16
  field :icon, -> { String }, optional: true, nullable: false
17
17
  field :id, -> { String }, optional: false, nullable: false
18
+ field :ledger_authority, -> { Schematic::Types::BillingCreditLedgerAuthority }, optional: false, nullable: false
18
19
  field :name, -> { String }, optional: false, nullable: false
19
20
  field :plural_name, -> { String }, optional: true, nullable: false
20
21
  field :price, -> { Schematic::Types::BillingPriceView }, optional: true, nullable: false
@@ -30,6 +30,7 @@ module Schematic
30
30
  field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
31
31
  field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: true, nullable: false
32
32
  field :reset_type, -> { Schematic::Types::BillingPlanCreditGrantResetType }, optional: true, nullable: false
33
+ field :rollover_percentage, -> { Integer }, optional: false, nullable: false
33
34
  field :updated_at, -> { String }, optional: false, nullable: false
34
35
  end
35
36
  end
@@ -5,6 +5,7 @@ module Schematic
5
5
  module BillingProviderType
6
6
  extend Schematic::Internal::Types::Enum
7
7
 
8
+ METRONOME = "metronome"
8
9
  ORB = "orb"
9
10
  SCHEMATIC = "schematic"
10
11
  STRIPE = "stripe"
@@ -8,8 +8,10 @@ module Schematic
8
8
  field :company_id, -> { String }, optional: false, nullable: false
9
9
  field :coupon_external_id, -> { String }, optional: true, nullable: false
10
10
  field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::UpdateCreditBundleRequestBody] }, optional: false, nullable: false
11
+ field :custom_field_values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false
11
12
  field :new_plan_id, -> { String }, optional: false, nullable: false
12
13
  field :new_price_id, -> { String }, optional: false, nullable: false
14
+ field :opt_in_accepted, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
15
  field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
14
16
  field :payment_method_id, -> { String }, optional: true, nullable: false
15
17
  field :promo_code, -> { String }, optional: true, nullable: false
@@ -7,8 +7,10 @@ module Schematic
7
7
  field :auto_topup_overrides, -> { Internal::Types::Array[Schematic::Types::UpdateAutoTopupOverrideRequestBody] }, optional: false, nullable: false
8
8
  field :coupon_external_id, -> { String }, optional: true, nullable: false
9
9
  field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::UpdateCreditBundleRequestBody] }, optional: false, nullable: false
10
+ field :custom_field_values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false
10
11
  field :new_plan_id, -> { String }, optional: false, nullable: false
11
12
  field :new_price_id, -> { String }, optional: false, nullable: false
13
+ field :opt_in_accepted, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
14
  field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
13
15
  field :payment_method_id, -> { String }, optional: true, nullable: false
14
16
  field :promo_code, -> { String }, optional: true, nullable: false
@@ -8,6 +8,7 @@ module Schematic
8
8
  field :active_usage_based_entitlements, -> { Internal::Types::Array[Schematic::Types::UsageBasedEntitlementResponseData] }, optional: false, nullable: false
9
9
  field :available_credit_bundles, -> { Internal::Types::Array[Schematic::Types::BillingCreditBundleResponseData] }, optional: false, nullable: false
10
10
  field :company, -> { Schematic::Types::CompanyDetailResponseData }, optional: true, nullable: false
11
+ field :custom_checkout_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldWithValue] }, optional: false, nullable: false
11
12
  field :feature_usage, -> { Schematic::Types::FeatureUsageDetailResponseData }, optional: true, nullable: false
12
13
  field :selected_credit_bundles, -> { Internal::Types::Array[Schematic::Types::CreditBundlePurchaseResponseData] }, optional: false, nullable: false
13
14
  field :selected_plan, -> { Schematic::Types::PlanDetailResponseData }, optional: true, nullable: false
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CheckoutFieldInput < Internal::Types::Model
6
+ field :definition_id, -> { String }, optional: true, nullable: false
7
+ field :helper_text, -> { String }, optional: true, nullable: false
8
+ field :id, -> { String }, optional: true, nullable: false
9
+ field :name, -> { String }, optional: false, nullable: false
10
+ field :required, -> { Internal::Types::Boolean }, optional: false, nullable: false
11
+ field :stripe_metadata_key, -> { String }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CheckoutFieldResponseData < Internal::Types::Model
6
+ field :created_at, -> { String }, optional: false, nullable: false
7
+ field :definition_id, -> { String }, optional: false, nullable: false
8
+ field :helper_text, -> { String }, optional: true, nullable: false
9
+ field :id, -> { String }, optional: false, nullable: false
10
+ field :name, -> { String }, optional: false, nullable: false
11
+ field :position, -> { Integer }, optional: false, nullable: false
12
+ field :required, -> { Internal::Types::Boolean }, optional: false, nullable: false
13
+ field :stripe_metadata_key, -> { String }, optional: false, nullable: false
14
+ field :trait_hierarchy, -> { Internal::Types::Array[String] }, optional: false, nullable: false
15
+ field :updated_at, -> { String }, optional: false, nullable: false
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CheckoutFieldValue < Internal::Types::Model
6
+ field :id, -> { String }, optional: false, nullable: false
7
+ field :value, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CheckoutFieldWithValue < Internal::Types::Model
6
+ field :definition_id, -> { String }, optional: false, nullable: false
7
+ field :helper_text, -> { String }, optional: true, nullable: false
8
+ field :id, -> { String }, optional: false, nullable: false
9
+ field :name, -> { String }, optional: false, nullable: false
10
+ field :required, -> { Internal::Types::Boolean }, optional: false, nullable: false
11
+ field :stripe_metadata_key, -> { String }, optional: false, nullable: false
12
+ field :value, -> { String }, optional: true, nullable: false
13
+ end
14
+ end
15
+ end
@@ -6,6 +6,9 @@ module Schematic
6
6
  field :collect_address, -> { Internal::Types::Boolean }, optional: false, nullable: false
7
7
  field :collect_email, -> { Internal::Types::Boolean }, optional: false, nullable: false
8
8
  field :collect_phone, -> { Internal::Types::Boolean }, optional: false, nullable: false
9
+ field :opt_in_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
10
+ field :opt_in_text, -> { String }, optional: true, nullable: false
11
+ field :opt_in_title, -> { String }, optional: true, nullable: false
9
12
  end
10
13
  end
11
14
  end
@@ -5,6 +5,8 @@ module Schematic
5
5
  class CompanyCreditBalanceResponseData < Internal::Types::Model
6
6
  field :credit_id, -> { String }, optional: false, nullable: false
7
7
  field :remaining, -> { Integer }, optional: false, nullable: false
8
+ field :reserved, -> { Integer }, optional: false, nullable: false
9
+ field :settled, -> { Integer }, optional: false, nullable: false
8
10
  field :source, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
9
11
  field :total, -> { Integer }, optional: true, nullable: false
10
12
  end
@@ -33,6 +33,7 @@ module Schematic
33
33
  field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
34
34
  field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: true, nullable: false
35
35
  field :reset_type, -> { Schematic::Types::BillingPlanCreditGrantResetType }, optional: false, nullable: false
36
+ field :rollover_percentage, -> { Integer }, optional: false, nullable: false
36
37
  field :singular_name, -> { String }, optional: true, nullable: false
37
38
  field :updated_at, -> { String }, optional: false, nullable: false
38
39
  end
@@ -13,6 +13,7 @@ module Schematic
13
13
  field :component, -> { Schematic::Types::ComponentResponseData }, optional: true, nullable: false
14
14
  field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::BillingCreditBundleView] }, optional: false, nullable: false
15
15
  field :credit_grants, -> { Internal::Types::Array[Schematic::Types::CreditCompanyGrantView] }, optional: false, nullable: false
16
+ field :custom_checkout_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldWithValue] }, optional: false, nullable: false
16
17
  field :default_plan, -> { Schematic::Types::PlanDetailResponseData }, optional: true, nullable: false
17
18
  field :display_settings, -> { Schematic::Types::ComponentDisplaySettings }, optional: false, nullable: false
18
19
  field :feature_usage, -> { Schematic::Types::FeatureUsageDetailResponseData }, optional: true, nullable: false
@@ -13,6 +13,7 @@ module Schematic
13
13
  field :component, -> { Schematic::Types::ComponentResponseData }, optional: true, nullable: false
14
14
  field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::BillingCreditBundleView] }, optional: false, nullable: false
15
15
  field :credit_grants, -> { Internal::Types::Array[Schematic::Types::CreditCompanyGrantView] }, optional: false, nullable: false
16
+ field :custom_checkout_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldWithValue] }, optional: false, nullable: false
16
17
  field :default_plan, -> { Schematic::Types::PlanDetailResponseData }, optional: true, nullable: false
17
18
  field :display_settings, -> { Schematic::Types::ComponentDisplaySettings }, optional: false, nullable: false
18
19
  field :feature_usage, -> { Schematic::Types::FeatureUsageDetailResponseData }, optional: true, nullable: false
@@ -23,6 +23,7 @@ module Schematic
23
23
  field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: false, nullable: false
24
24
  field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: false, nullable: false
25
25
  field :reset_type, -> { Schematic::Types::BillingPlanCreditGrantResetType }, optional: true, nullable: false
26
+ field :rollover_percentage, -> { Integer }, optional: true, nullable: false
26
27
  end
27
28
  end
28
29
  end
@@ -28,7 +28,10 @@ module Schematic
28
28
  field :quantity_used, -> { Integer }, optional: false, nullable: false
29
29
  field :renewal_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
30
30
  field :renewal_period, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
31
+ field :reserved, -> { Integer }, optional: true, nullable: false
32
+ field :settled, -> { Integer }, optional: true, nullable: false
31
33
  field :singular_name, -> { String }, optional: true, nullable: false
34
+ field :source_grant_id, -> { String }, optional: true, nullable: false
32
35
  field :source_label, -> { String }, optional: false, nullable: false
33
36
  field :transfers, -> { Internal::Types::Array[Schematic::Types::CreditTransferView] }, optional: true, nullable: false
34
37
  field :updated_at, -> { String }, optional: false, nullable: false
@@ -33,6 +33,7 @@ module Schematic
33
33
  field :source_id, -> { Integer }, optional: false, nullable: false
34
34
  field :to_grant_id, -> { String }, optional: true, nullable: false
35
35
  field :usage_event_id, -> { String }, optional: true, nullable: false
36
+ field :usage_reason, -> { Schematic::Types::CreditUsageReason }, optional: true, nullable: false
36
37
  field :zeroed_out_reason, -> { Schematic::Types::BillingCreditGrantZeroedOutReason }, optional: true, nullable: false
37
38
  end
38
39
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ module CreditUsageReason
6
+ extend Schematic::Internal::Types::Enum
7
+
8
+ LEASE_HOLD = "lease_hold"
9
+ LEASE_RELEASE = "lease_release"
10
+ MANUAL_ADJUSTMENT = "manual_adjustment"
11
+ RECONCILIATION = "reconciliation"
12
+ TRACK = "track"
13
+ end
14
+ end
15
+ end
@@ -17,6 +17,7 @@ module Schematic
17
17
  field :features, -> { Internal::Types::Array[Schematic::Types::PreviewObject] }, optional: false, nullable: false
18
18
  field :id, -> { String }, optional: false, nullable: false
19
19
  field :idempotency_key, -> { String }, optional: true, nullable: false
20
+ field :lease_id, -> { String }, optional: true, nullable: false
20
21
  field :loaded_at, -> { String }, optional: true, nullable: false
21
22
  field :processed_at, -> { String }, optional: true, nullable: false
22
23
  field :quantity, -> { Integer }, optional: false, nullable: false