schematichq 1.4.4 → 1.4.6

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/.fern/replay.lock +25 -1
  4. data/WASM_VERSION +1 -1
  5. data/lib/schematic/billing/client.rb +102 -2
  6. data/lib/schematic/billing/types/delete_billing_coupon_response.rb +12 -0
  7. data/lib/schematic/billing/types/delete_billing_customer_response.rb +12 -0
  8. data/lib/schematic/billing/types/delete_billing_invoice_response.rb +12 -0
  9. data/lib/schematic/billing/types/list_billing_prices_params.rb +1 -0
  10. data/lib/schematic/billing/types/list_billing_prices_request.rb +1 -0
  11. data/lib/schematic/billing/types/list_billing_product_prices_params.rb +1 -0
  12. data/lib/schematic/billing/types/list_billing_product_prices_request.rb +1 -0
  13. data/lib/schematic/client.rb +1 -1
  14. data/lib/schematic/credits/client.rb +0 -104
  15. data/lib/schematic/datastream/merge.rb +3 -4
  16. data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +3 -0
  17. data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +3 -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_permission.rb +0 -1
  21. data/lib/schematic/types/billing_credit_grant_zeroed_out_reason.rb +1 -0
  22. data/lib/schematic/types/change_subscription_internal_request_body.rb +1 -0
  23. data/lib/schematic/types/change_subscription_request_body.rb +1 -0
  24. data/lib/schematic/types/check_flags_response_data.rb +1 -0
  25. data/lib/schematic/types/checkout_settings_response_data.rb +3 -0
  26. data/lib/schematic/types/company_credit_balance.rb +11 -0
  27. data/lib/schematic/types/company_subscription_response_data.rb +1 -0
  28. data/lib/schematic/types/feature_entitlement.rb +4 -0
  29. data/lib/schematic/types/plan_change_response_data.rb +1 -0
  30. data/lib/schematic/types/preview_subscription_change_response_data.rb +3 -0
  31. data/lib/schematic/types/rulesengine_feature_entitlement.rb +4 -0
  32. data/lib/schematic/types/test_webhook_response_data.rb +10 -0
  33. data/lib/schematic/version.rb +1 -1
  34. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  35. data/lib/schematic/webhooks/client.rb +37 -0
  36. data/lib/schematic/webhooks/types/send_test_webhook_action_response.rb +12 -0
  37. data/lib/schematic/webhooks/types/test_webhook_request_body.rb +12 -0
  38. data/lib/schematic.rb +10 -11
  39. data/reference.md +383 -322
  40. metadata +9 -10
  41. data/lib/schematic/credits/types/count_credit_ledger_params.rb +0 -19
  42. data/lib/schematic/credits/types/count_credit_ledger_request.rb +0 -18
  43. data/lib/schematic/credits/types/count_credit_ledger_response.rb +0 -12
  44. data/lib/schematic/credits/types/get_enriched_credit_ledger_params.rb +0 -19
  45. data/lib/schematic/credits/types/get_enriched_credit_ledger_request.rb +0 -18
  46. data/lib/schematic/credits/types/get_enriched_credit_ledger_response.rb +0 -12
  47. data/lib/schematic/types/credit_ledger_enriched_entry_response_data.rb +0 -30
  48. data/lib/schematic/types/credit_ledger_period.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: beede11cf31a32d41acacecfcf43f24d415952cc1bfc02ae762593885d804030
4
- data.tar.gz: ca42025157214fcc6b06ce6313ce591ed78d7f9e49f033f6aad432dcef691097
3
+ metadata.gz: 6229824d941e4fc71c6c6c7bd9849d843c8aaee72140238da1b24084abe2c4e6
4
+ data.tar.gz: ed47a6602419d5d1b74f5d2513cdf9c1dc40651418285833b5f7672e8fbaeb46
5
5
  SHA512:
6
- metadata.gz: f36aa806e79e4dc3c547fd9580b021f616c1b187c659eb7f0784e28983cc5a1bf74f6c32b32edbca0234d0df3372b34aefb6974c0f2e21a059c6bfd56e91682d
7
- data.tar.gz: e8fb63d038eedf92d7fd992b18cd94931d599abe632640cb44b482eada7161392c8a373e18494b44c5acfbba3909ef1b4b61d3120763538630d68c0ceb9a7105
6
+ metadata.gz: fba8e4ee8af143a05af7c33950fb3b977db5aa634df7a469f6a67e2697d0b53ad88e94d7e485f5fb14d55f1bb6684dcb60b192d88c2be3e3cf650ef08bb95670
7
+ data.tar.gz: 7c7ba025d48148e3720c059526eb969a3a0f83ae5994c3ad657dc3d88e43954993eb074bae4b21b0c199837d3021ac192d716873963a09739a456f524bb5e471
data/.fern/metadata.json CHANGED
@@ -13,6 +13,6 @@
13
13
  "webrick": ">= 1.0"
14
14
  }
15
15
  },
16
- "originGitCommit": "ad1cc528e658e3693935b819c9d22eed02d49017",
17
- "sdkVersion": "1.4.4"
16
+ "originGitCommit": "26286134afce586aa5dbd02bffc9f25da6217032",
17
+ "sdkVersion": "1.4.6"
18
18
  }
data/.fern/replay.lock CHANGED
@@ -6,5 +6,29 @@ generations:
6
6
  timestamp: 2026-05-19T19:48:36.665Z
7
7
  cli_version: unknown
8
8
  generator_versions: {}
9
- current_generation: 298b1d0ee88b6637d99742bff32b353cfbd5b32e
9
+ - commit_sha: 0dd219c7b903329d9db2fb5b9fb570f2fd6e1a39
10
+ tree_hash: 7a0aadd77d8091d4846b0968fc36d335be98a66d
11
+ timestamp: 2026-06-08T18:13:52.357Z
12
+ cli_version: unknown
13
+ generator_versions:
14
+ fernapi/fern-ruby-sdk: 1.1.13
15
+ - commit_sha: 3f7bc10e75ced0491ab79b97ad6728099789257f
16
+ tree_hash: c0da19d256703af10c64a60eb7b5bac46c309176
17
+ timestamp: 2026-06-16T15:23:35.904Z
18
+ cli_version: unknown
19
+ generator_versions:
20
+ fernapi/fern-ruby-sdk: 1.1.13
21
+ - commit_sha: 7ff89cac80a7358534185779ed4992b755919d97
22
+ tree_hash: 0067d3b0febf9fcc16a4e73c0b6df32358a38c52
23
+ timestamp: 2026-06-22T12:02:24.084Z
24
+ cli_version: unknown
25
+ generator_versions:
26
+ fernapi/fern-ruby-sdk: 1.1.13
27
+ - commit_sha: 8487841eae05855059210650ab3ee913538f1afc
28
+ tree_hash: 391a12403ced58b9d8dfaa76de05467a95b1b8f9
29
+ timestamp: 2026-06-22T18:51:25.550Z
30
+ cli_version: unknown
31
+ generator_versions:
32
+ fernapi/fern-ruby-sdk: 1.1.13
33
+ current_generation: 8487841eae05855059210650ab3ee913538f1afc
10
34
  patches: []
data/WASM_VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
@@ -86,6 +86,70 @@ module Schematic
86
86
  end
87
87
  end
88
88
 
89
+ # @param request_options [Hash]
90
+ # @param params [Hash]
91
+ # @option request_options [String] :base_url
92
+ # @option request_options [Hash{String => Object}] :additional_headers
93
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
94
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
95
+ # @option request_options [Integer] :timeout_in_seconds
96
+ # @option params [String] :billing_id
97
+ #
98
+ # @return [Schematic::Billing::Types::DeleteBillingCouponResponse]
99
+ def delete_billing_coupon(request_options: {}, **params)
100
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
101
+ request = Schematic::Internal::JSON::Request.new(
102
+ base_url: request_options[:base_url],
103
+ method: "DELETE",
104
+ path: "billing/coupons/#{URI.encode_uri_component(params[:billing_id].to_s)}",
105
+ request_options: request_options
106
+ )
107
+ begin
108
+ response = @client.send(request)
109
+ rescue Net::HTTPRequestTimeout
110
+ raise Schematic::Errors::TimeoutError
111
+ end
112
+ code = response.code.to_i
113
+ if code.between?(200, 299)
114
+ Schematic::Billing::Types::DeleteBillingCouponResponse.load(response.body)
115
+ else
116
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
117
+ raise error_class.new(response.body, code: code)
118
+ end
119
+ end
120
+
121
+ # @param request_options [Hash]
122
+ # @param params [Hash]
123
+ # @option request_options [String] :base_url
124
+ # @option request_options [Hash{String => Object}] :additional_headers
125
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
126
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
127
+ # @option request_options [Integer] :timeout_in_seconds
128
+ # @option params [String] :billing_id
129
+ #
130
+ # @return [Schematic::Billing::Types::DeleteBillingCustomerResponse]
131
+ def delete_billing_customer(request_options: {}, **params)
132
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
133
+ request = Schematic::Internal::JSON::Request.new(
134
+ base_url: request_options[:base_url],
135
+ method: "DELETE",
136
+ path: "billing/customer/#{URI.encode_uri_component(params[:billing_id].to_s)}",
137
+ request_options: request_options
138
+ )
139
+ begin
140
+ response = @client.send(request)
141
+ rescue Net::HTTPRequestTimeout
142
+ raise Schematic::Errors::TimeoutError
143
+ end
144
+ code = response.code.to_i
145
+ if code.between?(200, 299)
146
+ Schematic::Billing::Types::DeleteBillingCustomerResponse.load(response.body)
147
+ else
148
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
149
+ raise error_class.new(response.body, code: code)
150
+ end
151
+ end
152
+
89
153
  # @param request_options [Hash]
90
154
  # @param params [Schematic::Billing::Types::CreateBillingCustomerRequestBody]
91
155
  # @option request_options [String] :base_url
@@ -292,6 +356,38 @@ module Schematic
292
356
  end
293
357
  end
294
358
 
359
+ # @param request_options [Hash]
360
+ # @param params [Hash]
361
+ # @option request_options [String] :base_url
362
+ # @option request_options [Hash{String => Object}] :additional_headers
363
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
364
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
365
+ # @option request_options [Integer] :timeout_in_seconds
366
+ # @option params [String] :billing_id
367
+ #
368
+ # @return [Schematic::Billing::Types::DeleteBillingInvoiceResponse]
369
+ def delete_billing_invoice(request_options: {}, **params)
370
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
371
+ request = Schematic::Internal::JSON::Request.new(
372
+ base_url: request_options[:base_url],
373
+ method: "DELETE",
374
+ path: "billing/invoices/#{URI.encode_uri_component(params[:billing_id].to_s)}",
375
+ request_options: request_options
376
+ )
377
+ begin
378
+ response = @client.send(request)
379
+ rescue Net::HTTPRequestTimeout
380
+ raise Schematic::Errors::TimeoutError
381
+ end
382
+ code = response.code.to_i
383
+ if code.between?(200, 299)
384
+ Schematic::Billing::Types::DeleteBillingInvoiceResponse.load(response.body)
385
+ else
386
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
387
+ raise error_class.new(response.body, code: code)
388
+ end
389
+ end
390
+
295
391
  # @param request_options [Hash]
296
392
  # @param params [Hash]
297
393
  # @option request_options [String] :base_url
@@ -487,6 +583,7 @@ module Schematic
487
583
  # @option params [String, nil] :ids
488
584
  # @option params [String, nil] :interval
489
585
  # @option params [Boolean, nil] :is_active
586
+ # @option params [String, nil] :plan_version_id
490
587
  # @option params [Integer, nil] :price
491
588
  # @option params [String, nil] :product_id
492
589
  # @option params [String, nil] :product_ids
@@ -501,7 +598,7 @@ module Schematic
501
598
  # @return [Schematic::Billing::Types::ListBillingPricesResponse]
502
599
  def list_billing_prices(request_options: {}, **params)
503
600
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
504
- query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
601
+ query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
505
602
  query_params = {}
506
603
  query_params["currency"] = params[:currency] if params.key?(:currency)
507
604
  query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
@@ -509,6 +606,7 @@ module Schematic
509
606
  query_params["ids"] = params[:ids] if params.key?(:ids)
510
607
  query_params["interval"] = params[:interval] if params.key?(:interval)
511
608
  query_params["is_active"] = params[:is_active] if params.key?(:is_active)
609
+ query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
512
610
  query_params["price"] = params[:price] if params.key?(:price)
513
611
  query_params["product_id"] = params[:product_id] if params.key?(:product_id)
514
612
  query_params["product_ids"] = params[:product_ids] if params.key?(:product_ids)
@@ -619,6 +717,7 @@ module Schematic
619
717
  # @option params [String, nil] :ids
620
718
  # @option params [String, nil] :interval
621
719
  # @option params [Boolean, nil] :is_active
720
+ # @option params [String, nil] :plan_version_id
622
721
  # @option params [Integer, nil] :price
623
722
  # @option params [String, nil] :product_id
624
723
  # @option params [String, nil] :product_ids
@@ -633,7 +732,7 @@ module Schematic
633
732
  # @return [Schematic::Billing::Types::ListBillingProductPricesResponse]
634
733
  def list_billing_product_prices(request_options: {}, **params)
635
734
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
636
- query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
735
+ query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
637
736
  query_params = {}
638
737
  query_params["currency"] = params[:currency] if params.key?(:currency)
639
738
  query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
@@ -641,6 +740,7 @@ module Schematic
641
740
  query_params["ids"] = params[:ids] if params.key?(:ids)
642
741
  query_params["interval"] = params[:interval] if params.key?(:interval)
643
742
  query_params["is_active"] = params[:is_active] if params.key?(:is_active)
743
+ query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
644
744
  query_params["price"] = params[:price] if params.key?(:price)
645
745
  query_params["product_id"] = params[:product_id] if params.key?(:product_id)
646
746
  query_params["product_ids"] = params[:product_ids] if params.key?(:product_ids)
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Billing
5
+ module Types
6
+ class DeleteBillingCouponResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::DeleteResponse }, 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 Billing
5
+ module Types
6
+ class DeleteBillingCustomerResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::DeleteResponse }, 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 Billing
5
+ module Types
6
+ class DeleteBillingInvoiceResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::DeleteResponse }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -13,6 +13,7 @@ module Schematic
13
13
  field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
14
  field :limit, -> { Integer }, optional: true, nullable: false
15
15
  field :offset, -> { Integer }, optional: true, nullable: false
16
+ field :plan_version_id, -> { String }, optional: true, nullable: false
16
17
  field :price, -> { Integer }, optional: true, nullable: false
17
18
  field :product_id, -> { String }, optional: true, nullable: false
18
19
  field :product_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :ids, -> { String }, optional: true, nullable: false
11
11
  field :interval, -> { String }, optional: true, nullable: false
12
12
  field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
+ field :plan_version_id, -> { String }, optional: true, nullable: false
13
14
  field :price, -> { Integer }, optional: true, nullable: false
14
15
  field :product_id, -> { String }, optional: true, nullable: false
15
16
  field :product_ids, -> { String }, optional: true, nullable: false
@@ -13,6 +13,7 @@ module Schematic
13
13
  field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
14
  field :limit, -> { Integer }, optional: true, nullable: false
15
15
  field :offset, -> { Integer }, optional: true, nullable: false
16
+ field :plan_version_id, -> { String }, optional: true, nullable: false
16
17
  field :price, -> { Integer }, optional: true, nullable: false
17
18
  field :product_id, -> { String }, optional: true, nullable: false
18
19
  field :product_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :ids, -> { String }, optional: true, nullable: false
11
11
  field :interval, -> { String }, optional: true, nullable: false
12
12
  field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
+ field :plan_version_id, -> { String }, optional: true, nullable: false
13
14
  field :price, -> { Integer }, optional: true, nullable: false
14
15
  field :product_id, -> { String }, optional: true, nullable: false
15
16
  field :product_ids, -> { String }, optional: true, nullable: false
@@ -10,7 +10,7 @@ module Schematic
10
10
  @raw_client = Schematic::Internal::Http::RawClient.new(
11
11
  base_url: base_url || Schematic::Environment::DEFAULT,
12
12
  headers: {
13
- "User-Agent" => "schematichq/1.4.4",
13
+ "User-Agent" => "schematichq/1.4.6",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "X-Schematic-Api-Key" => api_key.to_s
16
16
  }
@@ -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
@@ -46,7 +46,7 @@ module Schematic
46
46
  end
47
47
  end
48
48
 
49
- if (updated_balances&.any? || metrics_updated) && !entitlements_in_partial
49
+ if (updated_balances || metrics_updated) && !entitlements_in_partial
50
50
  result[:entitlements] = sync_entitlements(
51
51
  result[:entitlements], result[:metrics], updated_balances, metrics_updated
52
52
  )
@@ -152,9 +152,8 @@ module Schematic
152
152
  end
153
153
  end
154
154
 
155
- # The partial's credit_balances may be keyed by string or symbol depending
156
- # on how the message was parsed, while an entitlement's credit_id is a
157
- # string value, so check both key forms.
155
+ # credit_balances keys may be symbols (deep_copy symbolizes) while an
156
+ # entitlement's credit_id is always a string, so check both forms.
158
157
  def fetch_balance(balances, credit_id)
159
158
  return [true, balances[credit_id]] if balances.key?(credit_id)
160
159
  return [true, balances[credit_id.to_sym]] if balances.key?(credit_id.to_sym)
@@ -16,6 +16,9 @@ module Schematic
16
16
  field :fallback_plan_id, -> { String }, optional: true, nullable: false
17
17
  field :initial_plan_id, -> { String }, optional: true, nullable: false
18
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
19
22
  field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::OrderedPlansInGroup] }, optional: false, nullable: false
20
23
  field :ordered_bundle_list, -> { Internal::Types::Array[Schematic::Types::PlanGroupBundleOrder] }, optional: false, nullable: false
21
24
  field :ordered_plans, -> { Internal::Types::Array[Schematic::Types::OrderedPlansInGroup] }, optional: false, nullable: false
@@ -17,6 +17,9 @@ module Schematic
17
17
  field :fallback_plan_id, -> { String }, optional: true, nullable: false
18
18
  field :initial_plan_id, -> { String }, optional: true, nullable: false
19
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
20
23
  field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::OrderedPlansInGroup] }, optional: false, nullable: false
21
24
  field :ordered_bundle_list, -> { Internal::Types::Array[Schematic::Types::PlanGroupBundleOrder] }, optional: false, nullable: false
22
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,7 +5,6 @@ module Schematic
5
5
  module AccountMemberPermission
6
6
  extend Schematic::Internal::Types::Enum
7
7
 
8
- BILLING_CREDITS_EDIT = "billing_credits_edit"
9
8
  COMPANIES_EDIT = "companies_edit"
10
9
  COMPANY_USERS_EDIT = "company_users_edit"
11
10
  COMPONENTS_EDIT = "components_edit"
@@ -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
@@ -11,6 +11,7 @@ module Schematic
11
11
  field :custom_field_values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false
12
12
  field :new_plan_id, -> { String }, optional: false, nullable: false
13
13
  field :new_price_id, -> { String }, optional: false, nullable: false
14
+ field :opt_in_accepted, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
15
  field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
15
16
  field :payment_method_id, -> { String }, optional: true, nullable: false
16
17
  field :promo_code, -> { String }, optional: true, nullable: false
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :custom_field_values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false
11
11
  field :new_plan_id, -> { String }, optional: false, nullable: false
12
12
  field :new_price_id, -> { String }, optional: false, nullable: false
13
+ field :opt_in_accepted, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
14
  field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
14
15
  field :payment_method_id, -> { String }, optional: true, nullable: false
15
16
  field :promo_code, -> { String }, optional: true, nullable: false
@@ -3,6 +3,7 @@
3
3
  module Schematic
4
4
  module Types
5
5
  class CheckFlagsResponseData < Internal::Types::Model
6
+ field :credit_balances, -> { Internal::Types::Hash[String, Schematic::Types::CompanyCreditBalance] }, optional: true, nullable: false
6
7
  field :flags, -> { Internal::Types::Array[Schematic::Types::CheckFlagResponseData] }, optional: false, nullable: false
7
8
  field :plan, -> { Schematic::Types::DatastreamCompanyPlan }, optional: true, nullable: false
8
9
  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
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CompanyCreditBalance < Internal::Types::Model
6
+ field :remaining, -> { Integer }, optional: false, nullable: false
7
+ field :reserved, -> { Integer }, optional: false, nullable: false
8
+ field :settled, -> { Integer }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :discounts, -> { Internal::Types::Array[Schematic::Types::BillingSubscriptionDiscountView] }, optional: false, nullable: false
11
11
  field :expired_at, -> { String }, optional: true, nullable: false
12
12
  field :interval, -> { String }, optional: false, nullable: false
13
+ field :is_initial, -> { Internal::Types::Boolean }, optional: false, nullable: false
13
14
  field :latest_invoice, -> { Schematic::Types::InvoiceResponseData }, optional: true, nullable: false
14
15
  field :payment_method, -> { Schematic::Types::PaymentMethodResponseData }, optional: true, nullable: false
15
16
  field :products, -> { Internal::Types::Array[Schematic::Types::BillingProductForSubscriptionResponseData] }, optional: false, nullable: false
@@ -4,11 +4,15 @@ module Schematic
4
4
  module Types
5
5
  class FeatureEntitlement < Internal::Types::Model
6
6
  field :allocation, -> { Integer }, optional: true, nullable: false
7
+ field :consumption_rate, -> { Integer }, optional: true, nullable: false
7
8
  field :credit_id, -> { String }, optional: true, nullable: false
8
9
  field :credit_remaining, -> { Integer }, optional: true, nullable: false
10
+ field :credit_reserved, -> { Integer }, optional: true, nullable: false
11
+ field :credit_settled, -> { Integer }, optional: true, nullable: false
9
12
  field :credit_total, -> { Integer }, optional: true, nullable: false
10
13
  field :credit_used, -> { Integer }, optional: true, nullable: false
11
14
  field :event_name, -> { String }, optional: true, nullable: false
15
+ field :event_subtype, -> { String }, optional: true, nullable: false
12
16
  field :feature_id, -> { String }, optional: false, nullable: false
13
17
  field :feature_key, -> { String }, optional: false, nullable: false
14
18
  field :metric_period, -> { Schematic::Types::MetricPeriod }, optional: true, nullable: false
@@ -17,6 +17,7 @@ module Schematic
17
17
  field :created_at, -> { String }, optional: false, nullable: false
18
18
  field :environment_id, -> { String }, optional: false, nullable: false
19
19
  field :id, -> { String }, optional: false, nullable: false
20
+ field :is_version_upgrade, -> { Internal::Types::Boolean }, optional: false, nullable: false
20
21
  field :previous_base_plan, -> { Schematic::Types::PlanSnapshotView }, optional: true, nullable: false
21
22
  field :previous_base_plan_version, -> { Schematic::Types::PlanVersionSnapshotView }, optional: true, nullable: false
22
23
  field :request_id, -> { String }, optional: true, nullable: false
@@ -8,6 +8,9 @@ module Schematic
8
8
  field :finance, -> { Schematic::Types::PreviewSubscriptionFinanceResponseData }, optional: true, nullable: false
9
9
  field :is_scheduled_downgrade, -> { Internal::Types::Boolean }, optional: false, nullable: false
10
10
  field :new_charges, -> { Integer }, optional: false, nullable: false
11
+ field :opt_in_required, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
+ field :opt_in_text, -> { String }, optional: true, nullable: false
13
+ field :opt_in_title, -> { String }, optional: true, nullable: false
11
14
  field :payment_method_required, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
15
  field :percent_off, -> { Integer }, optional: false, nullable: false
13
16
  field :period_start, -> { String }, optional: false, nullable: false
@@ -4,11 +4,15 @@ module Schematic
4
4
  module Types
5
5
  class RulesengineFeatureEntitlement < Internal::Types::Model
6
6
  field :allocation, -> { Integer }, optional: true, nullable: false
7
+ field :consumption_rate, -> { Integer }, optional: true, nullable: false
7
8
  field :credit_id, -> { String }, optional: true, nullable: false
8
9
  field :credit_remaining, -> { Integer }, optional: true, nullable: false
10
+ field :credit_reserved, -> { Integer }, optional: true, nullable: false
11
+ field :credit_settled, -> { Integer }, optional: true, nullable: false
9
12
  field :credit_total, -> { Integer }, optional: true, nullable: false
10
13
  field :credit_used, -> { Integer }, optional: true, nullable: false
11
14
  field :event_name, -> { String }, optional: true, nullable: false
15
+ field :event_subtype, -> { String }, optional: true, nullable: false
12
16
  field :feature_id, -> { String }, optional: false, nullable: false
13
17
  field :feature_key, -> { String }, optional: false, nullable: false
14
18
  field :metric_period, -> { Schematic::Types::RulesengineMetricPeriod }, optional: true, nullable: false
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class TestWebhookResponseData < Internal::Types::Model
6
+ field :response_code, -> { Integer }, optional: false, nullable: false
7
+ field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Schematic
4
- VERSION = "1.4.4"
4
+ VERSION = "1.4.6"
5
5
  end
Binary file