schematichq 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +3 -3
  3. data/.fern/replay.lock +10 -0
  4. data/.fernignore +3 -0
  5. data/README.md +1 -1
  6. data/lib/schematic/billing/client.rb +6 -2
  7. data/lib/schematic/billing/types/count_billing_products_params.rb +1 -0
  8. data/lib/schematic/billing/types/count_billing_products_request.rb +1 -0
  9. data/lib/schematic/billing/types/create_billing_price_request_body.rb +1 -0
  10. data/lib/schematic/billing/types/list_billing_products_params.rb +1 -0
  11. data/lib/schematic/billing/types/list_billing_products_request.rb +1 -0
  12. data/lib/schematic/client.rb +6 -6
  13. data/lib/schematic/credits/client.rb +6 -2
  14. data/lib/schematic/credits/types/count_billing_plan_credit_grants_params.rb +1 -0
  15. data/lib/schematic/credits/types/count_billing_plan_credit_grants_request.rb +1 -0
  16. data/lib/schematic/credits/types/list_billing_plan_credit_grants_params.rb +1 -0
  17. data/lib/schematic/credits/types/list_billing_plan_credit_grants_request.rb +1 -0
  18. data/lib/schematic/datastream/websocket_client.rb +32 -1
  19. data/lib/schematic/entitlements/client.rb +6 -2
  20. data/lib/schematic/entitlements/types/count_feature_usage_params.rb +1 -0
  21. data/lib/schematic/entitlements/types/count_feature_usage_request.rb +1 -0
  22. data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +4 -0
  23. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +4 -0
  24. data/lib/schematic/entitlements/types/list_feature_usage_params.rb +1 -0
  25. data/lib/schematic/entitlements/types/list_feature_usage_request.rb +1 -0
  26. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +4 -0
  27. data/lib/schematic/event_buffer.rb +10 -2
  28. data/lib/schematic/events/client.rb +3 -1
  29. data/lib/schematic/events/types/list_events_params.rb +1 -0
  30. data/lib/schematic/events/types/list_events_request.rb +1 -0
  31. data/lib/schematic/features/client.rb +6 -2
  32. data/lib/schematic/features/types/count_features_params.rb +1 -0
  33. data/lib/schematic/features/types/count_features_request.rb +1 -0
  34. data/lib/schematic/features/types/list_features_params.rb +1 -0
  35. data/lib/schematic/features/types/list_features_request.rb +1 -0
  36. data/lib/schematic/integrationsapi/client.rb +177 -0
  37. data/lib/schematic/integrationsapi/types/list_integrations_params.rb +18 -0
  38. data/lib/schematic/integrationsapi/types/list_integrations_request.rb +17 -0
  39. data/lib/schematic/integrationsapi/types/list_integrations_response.rb +12 -0
  40. data/lib/schematic/integrationsapi/types/load_sample_data_set_v_2_response.rb +12 -0
  41. data/lib/schematic/integrationsapi/types/run_integration_response.rb +12 -0
  42. data/lib/schematic/integrationsapi/types/start_data_import_request_body.rb +13 -0
  43. data/lib/schematic/integrationsapi/types/start_data_import_response.rb +12 -0
  44. data/lib/schematic/integrationsapi/types/uninstall_integration_response.rb +12 -0
  45. data/lib/schematic/planbundle/client.rb +32 -0
  46. data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +13 -0
  47. data/lib/schematic/planbundle/types/create_custom_plan_bundle_response.rb +12 -0
  48. data/lib/schematic/plans/client.rb +6 -2
  49. data/lib/schematic/plans/types/count_plans_params.rb +1 -0
  50. data/lib/schematic/plans/types/count_plans_request.rb +1 -0
  51. data/lib/schematic/plans/types/create_billing_linked_plan_request_body.rb +1 -0
  52. data/lib/schematic/plans/types/list_plans_params.rb +1 -0
  53. data/lib/schematic/plans/types/list_plans_request.rb +1 -0
  54. data/lib/schematic/types/api_key_create_response_data.rb +1 -0
  55. data/lib/schematic/types/api_key_integration_response_data.rb +11 -0
  56. data/lib/schematic/types/api_key_response_data.rb +1 -0
  57. data/lib/schematic/types/audit_log_list_response_data.rb +1 -0
  58. data/lib/schematic/types/audit_log_response_data.rb +1 -0
  59. data/lib/schematic/types/billing_credit_bundle_view.rb +1 -1
  60. data/lib/schematic/types/billing_credit_view.rb +1 -0
  61. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +1 -0
  62. data/lib/schematic/types/billing_price_response_data.rb +1 -0
  63. data/lib/schematic/types/billing_price_view.rb +1 -0
  64. data/lib/schematic/types/billing_product_for_subscription_response_data.rb +1 -0
  65. data/lib/schematic/types/billing_product_plan_response_data.rb +1 -0
  66. data/lib/schematic/types/billing_product_price_response_data.rb +1 -0
  67. data/lib/schematic/types/billing_strategy.rb +13 -0
  68. data/lib/schematic/types/change_subscription_internal_request_body.rb +1 -0
  69. data/lib/schematic/types/change_subscription_request_body.rb +1 -0
  70. data/lib/schematic/types/charge_type.rb +1 -0
  71. data/lib/schematic/types/clerk_integration_config.rb +10 -0
  72. data/lib/schematic/types/company_matching_criteria.rb +12 -0
  73. data/lib/schematic/types/company_plan_credit_grant_view.rb +40 -0
  74. data/lib/schematic/types/company_plan_detail_response_data.rb +2 -0
  75. data/lib/schematic/types/company_plan_with_billing_sub_view.rb +1 -1
  76. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +1 -0
  77. data/lib/schematic/types/create_custom_plan_bundle_plan_request_body.rb +12 -0
  78. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +4 -0
  79. data/lib/schematic/types/create_event_request_body.rb +3 -0
  80. data/lib/schematic/types/credit_currency_price.rb +10 -0
  81. data/lib/schematic/types/currency_price_request_body.rb +3 -0
  82. data/lib/schematic/types/data_event_payload.rb +3 -0
  83. data/lib/schematic/types/duplicate_plan_entitlements_response_response_data.rb +1 -0
  84. data/lib/schematic/types/entitlement_currency_prices_response_data.rb +1 -0
  85. data/lib/schematic/types/event_detail_response_data.rb +2 -0
  86. data/lib/schematic/types/event_response_data.rb +1 -0
  87. data/lib/schematic/types/feature_company_response_data.rb +1 -0
  88. data/lib/schematic/types/feature_usage_response_data.rb +1 -0
  89. data/lib/schematic/types/integration_capabilities.rb +11 -0
  90. data/lib/schematic/types/integration_config.rb +15 -0
  91. data/lib/schematic/types/integration_response_data.rb +13 -0
  92. data/lib/schematic/types/integration_state.rb +13 -0
  93. data/lib/schematic/types/integrations_data_set_response_data.rb +9 -0
  94. data/lib/schematic/types/integrations_list_response_data.rb +15 -0
  95. data/lib/schematic/types/integrations_response_data.rb +13 -0
  96. data/lib/schematic/types/orb_integration_config.rb +9 -0
  97. data/lib/schematic/types/plan_credit_grant_view.rb +1 -0
  98. data/lib/schematic/types/plan_currency_price_request_body.rb +1 -0
  99. data/lib/schematic/types/plan_currency_prices_response_data.rb +1 -0
  100. data/lib/schematic/types/plan_detail_response_data.rb +2 -0
  101. data/lib/schematic/types/plan_entitlement_response_data.rb +1 -0
  102. data/lib/schematic/types/plan_group_plan_detail_response_data.rb +2 -0
  103. data/lib/schematic/types/plan_view_public_response_data.rb +2 -0
  104. data/lib/schematic/types/rules_engine_schema_version.rb +1 -1
  105. data/lib/schematic/types/stripe_integration_config.rb +15 -0
  106. data/lib/schematic/types/update_auto_topup_override_request_body.rb +12 -0
  107. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +1 -0
  108. data/lib/schematic/types/upsert_billing_product_request_body.rb +3 -0
  109. data/lib/schematic/types/usage_based_entitlement_request_body.rb +4 -0
  110. data/lib/schematic/types/usage_based_entitlement_response_data.rb +1 -0
  111. data/lib/schematic/version.rb +1 -1
  112. data/lib/schematic.rb +37 -10
  113. data/reference.md +675 -88
  114. metadata +30 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f3af69ae06714ed229c0c900c09694c8eac9db7fc708a1c00470464cf55376f7
4
- data.tar.gz: dee24391f912af1e31b07421066c2c34117032a788624e6f6f55ec41d5324a53
3
+ metadata.gz: 3d21af200007a5f9fad7ebc682971bbad191e98c0b5f7cd10b691627651069c7
4
+ data.tar.gz: e944d620948b8acdb24d375eed9365982edf50c8ff089a6f4c74821cbb88a4c3
5
5
  SHA512:
6
- metadata.gz: e2d2a0985b527493b9282c58ba76eb828a8adce85cf22195d3a7644f9250957160fc138ebcdcc0fc1220e6e75b36fcaf232230d7cc804eb6ef7360055ea405bd
7
- data.tar.gz: 5aa1fe13cc209733d354cdc7e49295dd79bc9e7c2c9891eaa47c2af83af9f0bae28760c3e5dfd4e13ad225c7a6d3c4f499688fc46a0053dfd9fce43bea05f5b2
6
+ metadata.gz: 980692b9e74fbbf6683623e2502bd5ef153d78f5c20245bdb5d3cc26787eaa142f6ac345ba5873acfb29a2fa93a2e0c0beab40717c692e5f3154d731219fad9d
7
+ data.tar.gz: 0f16bc4c9d391123750a85530d21a7a4a841cf8962d2cc867912f2935f0627e732cbff5c1c56ed677302704636290f962794066c18d9cb6f4e2d74dc63f3890d
data/.fern/metadata.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "4.76.1",
2
+ "cliVersion": "5.6.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
4
  "generatorVersion": "1.1.13",
5
5
  "generatorConfig": {
@@ -13,6 +13,6 @@
13
13
  "webrick": ">= 1.0"
14
14
  }
15
15
  },
16
- "originGitCommit": "65ef3b80b68cd7596daad7fa53232ea510ad01f2",
17
- "sdkVersion": "1.4.1"
16
+ "originGitCommit": "3dc12b536625ca1efbb649f6c55df7da258c7e05",
17
+ "sdkVersion": "1.4.2"
18
18
  }
data/.fern/replay.lock ADDED
@@ -0,0 +1,10 @@
1
+ # DO NOT EDIT MANUALLY - Managed by Fern Replay
2
+ version: "1.0"
3
+ generations:
4
+ - commit_sha: 298b1d0ee88b6637d99742bff32b353cfbd5b32e
5
+ tree_hash: 5e94ea993931a768a9df010fe0bccdf52d154846
6
+ timestamp: 2026-05-19T19:48:36.665Z
7
+ cli_version: unknown
8
+ generator_versions: {}
9
+ current_generation: 298b1d0ee88b6637d99742bff32b353cfbd5b32e
10
+ patches: []
data/.fernignore CHANGED
@@ -19,3 +19,6 @@ lib/schematichq.rb
19
19
  scripts/
20
20
  test/custom.test.rb
21
21
  testapp/
22
+ .fern/replay.lock
23
+ .fern/replay.yml
24
+ .gitattributes
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # schematic-ruby
1
+ # Schematic Ruby SDK
2
2
 
3
3
  ## Installation and Setup
4
4
 
@@ -719,6 +719,7 @@ module Schematic
719
719
  # @option params [Schematic::Types::BillingPriceUsageType, nil] :price_usage_type
720
720
  # @option params [Schematic::Types::BillingProviderType, nil] :provider_type
721
721
  # @option params [String, nil] :q
722
+ # @option params [Boolean, nil] :recurring_charges_only
722
723
  # @option params [Boolean, nil] :with_one_time_charges
723
724
  # @option params [Boolean, nil] :with_prices_only
724
725
  # @option params [Boolean, nil] :with_zero_price
@@ -729,7 +730,7 @@ module Schematic
729
730
  # @return [Schematic::Billing::Types::ListBillingProductsResponse]
730
731
  def list_billing_products(request_options: {}, **params)
731
732
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
732
- query_param_names = %i[ids is_active name price_usage_type provider_type q with_one_time_charges with_prices_only with_zero_price without_linked_to_plan limit offset]
733
+ query_param_names = %i[ids is_active name price_usage_type provider_type q recurring_charges_only with_one_time_charges with_prices_only with_zero_price without_linked_to_plan limit offset]
733
734
  query_params = {}
734
735
  query_params["ids"] = params[:ids] if params.key?(:ids)
735
736
  query_params["is_active"] = params[:is_active] if params.key?(:is_active)
@@ -737,6 +738,7 @@ module Schematic
737
738
  query_params["price_usage_type"] = params[:price_usage_type] if params.key?(:price_usage_type)
738
739
  query_params["provider_type"] = params[:provider_type] if params.key?(:provider_type)
739
740
  query_params["q"] = params[:q] if params.key?(:q)
741
+ query_params["recurring_charges_only"] = params[:recurring_charges_only] if params.key?(:recurring_charges_only)
740
742
  query_params["with_one_time_charges"] = params[:with_one_time_charges] if params.key?(:with_one_time_charges)
741
743
  query_params["with_prices_only"] = params[:with_prices_only] if params.key?(:with_prices_only)
742
744
  query_params["with_zero_price"] = params[:with_zero_price] if params.key?(:with_zero_price)
@@ -779,6 +781,7 @@ module Schematic
779
781
  # @option params [Schematic::Types::BillingPriceUsageType, nil] :price_usage_type
780
782
  # @option params [Schematic::Types::BillingProviderType, nil] :provider_type
781
783
  # @option params [String, nil] :q
784
+ # @option params [Boolean, nil] :recurring_charges_only
782
785
  # @option params [Boolean, nil] :with_one_time_charges
783
786
  # @option params [Boolean, nil] :with_prices_only
784
787
  # @option params [Boolean, nil] :with_zero_price
@@ -789,7 +792,7 @@ module Schematic
789
792
  # @return [Schematic::Billing::Types::CountBillingProductsResponse]
790
793
  def count_billing_products(request_options: {}, **params)
791
794
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
792
- query_param_names = %i[ids is_active name price_usage_type provider_type q with_one_time_charges with_prices_only with_zero_price without_linked_to_plan limit offset]
795
+ query_param_names = %i[ids is_active name price_usage_type provider_type q recurring_charges_only with_one_time_charges with_prices_only with_zero_price without_linked_to_plan limit offset]
793
796
  query_params = {}
794
797
  query_params["ids"] = params[:ids] if params.key?(:ids)
795
798
  query_params["is_active"] = params[:is_active] if params.key?(:is_active)
@@ -797,6 +800,7 @@ module Schematic
797
800
  query_params["price_usage_type"] = params[:price_usage_type] if params.key?(:price_usage_type)
798
801
  query_params["provider_type"] = params[:provider_type] if params.key?(:provider_type)
799
802
  query_params["q"] = params[:q] if params.key?(:q)
803
+ query_params["recurring_charges_only"] = params[:recurring_charges_only] if params.key?(:recurring_charges_only)
800
804
  query_params["with_one_time_charges"] = params[:with_one_time_charges] if params.key?(:with_one_time_charges)
801
805
  query_params["with_prices_only"] = params[:with_prices_only] if params.key?(:with_prices_only)
802
806
  query_params["with_zero_price"] = params[:with_zero_price] if params.key?(:with_zero_price)
@@ -13,6 +13,7 @@ module Schematic
13
13
  field :price_usage_type, -> { Schematic::Types::BillingPriceUsageType }, optional: true, nullable: false
14
14
  field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
15
15
  field :q, -> { String }, optional: true, nullable: false
16
+ field :recurring_charges_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
16
17
  field :with_one_time_charges, -> { Internal::Types::Boolean }, optional: true, nullable: false
17
18
  field :with_prices_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
18
19
  field :with_zero_price, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :price_usage_type, -> { Schematic::Types::BillingPriceUsageType }, optional: true, nullable: false
11
11
  field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
12
12
  field :q, -> { String }, optional: true, nullable: false
13
+ field :recurring_charges_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
14
  field :with_one_time_charges, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
15
  field :with_prices_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
15
16
  field :with_zero_price, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -8,6 +8,7 @@ module Schematic
8
8
  field :currency, -> { String }, optional: false, nullable: false
9
9
  field :external_account_id, -> { String }, optional: false, nullable: false
10
10
  field :interval, -> { String }, optional: false, nullable: false
11
+ field :interval_count, -> { Integer }, optional: true, nullable: false
11
12
  field :is_active, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
13
  field :meter_id, -> { String }, optional: true, nullable: false
13
14
  field :nickname, -> { String }, optional: true, nullable: false
@@ -13,6 +13,7 @@ module Schematic
13
13
  field :price_usage_type, -> { Schematic::Types::BillingPriceUsageType }, optional: true, nullable: false
14
14
  field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
15
15
  field :q, -> { String }, optional: true, nullable: false
16
+ field :recurring_charges_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
16
17
  field :with_one_time_charges, -> { Internal::Types::Boolean }, optional: true, nullable: false
17
18
  field :with_prices_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
18
19
  field :with_zero_price, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :price_usage_type, -> { Schematic::Types::BillingPriceUsageType }, optional: true, nullable: false
11
11
  field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
12
12
  field :q, -> { String }, optional: true, nullable: false
13
+ field :recurring_charges_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
14
  field :with_one_time_charges, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
15
  field :with_prices_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
15
16
  field :with_zero_price, -> { Internal::Types::Boolean }, 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.1",
13
+ "User-Agent" => "schematichq/1.4.2",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "X-Schematic-Api-Key" => api_key.to_s
16
16
  }
@@ -57,6 +57,11 @@ module Schematic
57
57
  @components ||= Schematic::Components::Client.new(client: @raw_client)
58
58
  end
59
59
 
60
+ # @return [Schematic::Planbundle::Client]
61
+ def planbundle
62
+ @planbundle ||= Schematic::Planbundle::Client.new(client: @raw_client)
63
+ end
64
+
60
65
  # @return [Schematic::Dataexports::Client]
61
66
  def dataexports
62
67
  @dataexports ||= Schematic::Dataexports::Client.new(client: @raw_client)
@@ -82,11 +87,6 @@ module Schematic
82
87
  @integrationsapi ||= Schematic::Integrationsapi::Client.new(client: @raw_client)
83
88
  end
84
89
 
85
- # @return [Schematic::Planbundle::Client]
86
- def planbundle
87
- @planbundle ||= Schematic::Planbundle::Client.new(client: @raw_client)
88
- end
89
-
90
90
  # @return [Schematic::Plangroups::Client]
91
91
  def plangroups
92
92
  @plangroups ||= Schematic::Plangroups::Client.new(client: @raw_client)
@@ -863,19 +863,21 @@ module Schematic
863
863
  # @option params [String, nil] :plan_id
864
864
  # @option params [String, nil] :plan_ids
865
865
  # @option params [String, nil] :plan_version_id
866
+ # @option params [String, nil] :plan_version_ids
866
867
  # @option params [Integer, nil] :limit
867
868
  # @option params [Integer, nil] :offset
868
869
  #
869
870
  # @return [Schematic::Credits::Types::ListBillingPlanCreditGrantsResponse]
870
871
  def list_billing_plan_credit_grants(request_options: {}, **params)
871
872
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
872
- query_param_names = %i[credit_id ids plan_id plan_ids plan_version_id limit offset]
873
+ query_param_names = %i[credit_id ids plan_id plan_ids plan_version_id plan_version_ids limit offset]
873
874
  query_params = {}
874
875
  query_params["credit_id"] = params[:credit_id] if params.key?(:credit_id)
875
876
  query_params["ids"] = params[:ids] if params.key?(:ids)
876
877
  query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
877
878
  query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids)
878
879
  query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
880
+ query_params["plan_version_ids"] = params[:plan_version_ids] if params.key?(:plan_version_ids)
879
881
  query_params["limit"] = params[:limit] if params.key?(:limit)
880
882
  query_params["offset"] = params[:offset] if params.key?(:offset)
881
883
  params.except(*query_param_names)
@@ -1049,19 +1051,21 @@ module Schematic
1049
1051
  # @option params [String, nil] :plan_id
1050
1052
  # @option params [String, nil] :plan_ids
1051
1053
  # @option params [String, nil] :plan_version_id
1054
+ # @option params [String, nil] :plan_version_ids
1052
1055
  # @option params [Integer, nil] :limit
1053
1056
  # @option params [Integer, nil] :offset
1054
1057
  #
1055
1058
  # @return [Schematic::Credits::Types::CountBillingPlanCreditGrantsResponse]
1056
1059
  def count_billing_plan_credit_grants(request_options: {}, **params)
1057
1060
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
1058
- query_param_names = %i[credit_id ids plan_id plan_ids plan_version_id limit offset]
1061
+ query_param_names = %i[credit_id ids plan_id plan_ids plan_version_id plan_version_ids limit offset]
1059
1062
  query_params = {}
1060
1063
  query_params["credit_id"] = params[:credit_id] if params.key?(:credit_id)
1061
1064
  query_params["ids"] = params[:ids] if params.key?(:ids)
1062
1065
  query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
1063
1066
  query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids)
1064
1067
  query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
1068
+ query_params["plan_version_ids"] = params[:plan_version_ids] if params.key?(:plan_version_ids)
1065
1069
  query_params["limit"] = params[:limit] if params.key?(:limit)
1066
1070
  query_params["offset"] = params[:offset] if params.key?(:offset)
1067
1071
  params.except(*query_param_names)
@@ -12,6 +12,7 @@ module Schematic
12
12
  field :plan_id, -> { String }, optional: true, nullable: false
13
13
  field :plan_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
14
14
  field :plan_version_id, -> { String }, optional: true, nullable: false
15
+ field :plan_version_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
15
16
  end
16
17
  end
17
18
  end
@@ -9,6 +9,7 @@ module Schematic
9
9
  field :plan_id, -> { String }, optional: true, nullable: false
10
10
  field :plan_ids, -> { String }, optional: true, nullable: false
11
11
  field :plan_version_id, -> { String }, optional: true, nullable: false
12
+ field :plan_version_ids, -> { String }, optional: true, nullable: false
12
13
  field :limit, -> { Integer }, optional: true, nullable: false
13
14
  field :offset, -> { Integer }, optional: true, nullable: false
14
15
  end
@@ -12,6 +12,7 @@ module Schematic
12
12
  field :plan_id, -> { String }, optional: true, nullable: false
13
13
  field :plan_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
14
14
  field :plan_version_id, -> { String }, optional: true, nullable: false
15
+ field :plan_version_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
15
16
  end
16
17
  end
17
18
  end
@@ -9,6 +9,7 @@ module Schematic
9
9
  field :plan_id, -> { String }, optional: true, nullable: false
10
10
  field :plan_ids, -> { String }, optional: true, nullable: false
11
11
  field :plan_version_id, -> { String }, optional: true, nullable: false
12
+ field :plan_version_ids, -> { String }, optional: true, nullable: false
12
13
  field :limit, -> { Integer }, optional: true, nullable: false
13
14
  field :offset, -> { Integer }, optional: true, nullable: false
14
15
  end
@@ -6,6 +6,8 @@ require "uri"
6
6
  require "json"
7
7
  require "websocket"
8
8
 
9
+ require_relative "../version"
10
+
9
11
  module Schematic
10
12
  module DataStream
11
13
  WRITE_WAIT = 10 # seconds
@@ -27,6 +29,14 @@ module Schematic
27
29
  MESSAGE_TYPE_DELETE = "delete"
28
30
  MESSAGE_TYPE_ERROR = "error"
29
31
 
32
+ # Headers attached to the WebSocket handshake so the backend can distinguish
33
+ # direct-SDK connections from the schematic-datastream-replicator and
34
+ # correlate either to a specific release. Mode is always "direct" here —
35
+ # replicator mode in this SDK doesn't open a WebSocket at all.
36
+ CLIENT_NAME = "schematic-ruby"
37
+ DATASTREAM_MODE_DIRECT = "direct"
38
+ UNKNOWN_VERSION = "unknown"
39
+
30
40
  class WebSocketClient
31
41
  attr_reader :url, :connected, :ready
32
42
 
@@ -154,7 +164,7 @@ module Schematic
154
164
  def perform_handshake
155
165
  @handshake = WebSocket::Handshake::Client.new(
156
166
  url: @url,
157
- headers: { "X-Schematic-Api-Key" => @api_key }
167
+ headers: handshake_headers
158
168
  )
159
169
 
160
170
  @socket.write(@handshake.to_s)
@@ -310,6 +320,27 @@ module Schematic
310
320
  )
311
321
  @write_mutex.synchronize { @socket&.write(frame.to_s) }
312
322
  end
323
+
324
+ # Headers attached to the WebSocket handshake. The mode/client headers let
325
+ # the backend tell direct-SDK connections apart from the
326
+ # schematic-datastream-replicator and correlate them to a release.
327
+ def handshake_headers
328
+ {
329
+ "X-Schematic-Api-Key" => @api_key,
330
+ "X-Schematic-Datastream-Mode" => DATASTREAM_MODE_DIRECT,
331
+ "X-Schematic-Client" => CLIENT_NAME,
332
+ "X-Schematic-Client-Version" => sdk_version
333
+ }
334
+ end
335
+
336
+ # Resolves the SDK version reported in handshake headers. Schematic::VERSION
337
+ # is stamped into the Fern-generated lib/schematic/version.rb on each release;
338
+ # fall back to "unknown" if the constant is missing (e.g. a partial checkout).
339
+ def sdk_version
340
+ return Schematic::VERSION if defined?(Schematic::VERSION) && !Schematic::VERSION.to_s.empty?
341
+
342
+ UNKNOWN_VERSION
343
+ end
313
344
  end
314
345
  end
315
346
  end
@@ -350,6 +350,7 @@ module Schematic
350
350
  # @option params [Hash[String, String], nil] :company_keys
351
351
  # @option params [String, nil] :feature_ids
352
352
  # @option params [Boolean, nil] :include_usage_aggregation
353
+ # @option params [Schematic::Types::BillingProviderType, nil] :managed_by
353
354
  # @option params [String, nil] :q
354
355
  # @option params [Boolean, nil] :without_negative_entitlements
355
356
  # @option params [Integer, nil] :limit
@@ -358,12 +359,13 @@ module Schematic
358
359
  # @return [Schematic::Entitlements::Types::ListFeatureUsageResponse]
359
360
  def list_feature_usage(request_options: {}, **params)
360
361
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
361
- query_param_names = %i[company_id company_keys feature_ids include_usage_aggregation q without_negative_entitlements limit offset]
362
+ query_param_names = %i[company_id company_keys feature_ids include_usage_aggregation managed_by q without_negative_entitlements limit offset]
362
363
  query_params = {}
363
364
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
364
365
  query_params["company_keys"] = params[:company_keys] if params.key?(:company_keys)
365
366
  query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids)
366
367
  query_params["include_usage_aggregation"] = params[:include_usage_aggregation] if params.key?(:include_usage_aggregation)
368
+ query_params["managed_by"] = params[:managed_by] if params.key?(:managed_by)
367
369
  query_params["q"] = params[:q] if params.key?(:q)
368
370
  query_params["without_negative_entitlements"] = params[:without_negative_entitlements] if params.key?(:without_negative_entitlements)
369
371
  query_params["limit"] = params[:limit] if params.key?(:limit)
@@ -448,6 +450,7 @@ module Schematic
448
450
  # @option params [Hash[String, String], nil] :company_keys
449
451
  # @option params [String, nil] :feature_ids
450
452
  # @option params [Boolean, nil] :include_usage_aggregation
453
+ # @option params [Schematic::Types::BillingProviderType, nil] :managed_by
451
454
  # @option params [String, nil] :q
452
455
  # @option params [Boolean, nil] :without_negative_entitlements
453
456
  # @option params [Integer, nil] :limit
@@ -456,12 +459,13 @@ module Schematic
456
459
  # @return [Schematic::Entitlements::Types::CountFeatureUsageResponse]
457
460
  def count_feature_usage(request_options: {}, **params)
458
461
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
459
- query_param_names = %i[company_id company_keys feature_ids include_usage_aggregation q without_negative_entitlements limit offset]
462
+ query_param_names = %i[company_id company_keys feature_ids include_usage_aggregation managed_by q without_negative_entitlements limit offset]
460
463
  query_params = {}
461
464
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
462
465
  query_params["company_keys"] = params[:company_keys] if params.key?(:company_keys)
463
466
  query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids)
464
467
  query_params["include_usage_aggregation"] = params[:include_usage_aggregation] if params.key?(:include_usage_aggregation)
468
+ query_params["managed_by"] = params[:managed_by] if params.key?(:managed_by)
465
469
  query_params["q"] = params[:q] if params.key?(:q)
466
470
  query_params["without_negative_entitlements"] = params[:without_negative_entitlements] if params.key?(:without_negative_entitlements)
467
471
  query_params["limit"] = params[:limit] if params.key?(:limit)
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :feature_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
11
11
  field :include_usage_aggregation, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
12
  field :limit, -> { Integer }, optional: true, nullable: false
13
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
13
14
  field :offset, -> { Integer }, optional: true, nullable: false
14
15
  field :q, -> { String }, optional: true, nullable: false
15
16
  field :without_negative_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -8,6 +8,7 @@ module Schematic
8
8
  field :company_keys, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
9
9
  field :feature_ids, -> { String }, optional: true, nullable: false
10
10
  field :include_usage_aggregation, -> { Internal::Types::Boolean }, optional: true, nullable: false
11
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
11
12
  field :q, -> { String }, optional: true, nullable: false
12
13
  field :without_negative_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
14
  field :limit, -> { Integer }, optional: true, nullable: false
@@ -23,6 +23,10 @@ module Schematic
23
23
  field :plan_version_id, -> { String }, optional: true, nullable: false
24
24
  field :price_behavior, -> { Schematic::Types::EntitlementPriceBehavior }, optional: true, nullable: false
25
25
  field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
26
+ field :quarterly_metered_price_id, -> { String }, optional: true, nullable: false
27
+ field :quarterly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
28
+ field :quarterly_unit_price, -> { Integer }, optional: true, nullable: false
29
+ field :quarterly_unit_price_decimal, -> { String }, optional: true, nullable: false
26
30
  field :soft_limit, -> { Integer }, optional: true, nullable: false
27
31
  field :tier_mode, -> { Schematic::Types::BillingTiersMode }, optional: true, nullable: false
28
32
  field :value_bool, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -21,6 +21,10 @@ module Schematic
21
21
  field :plan_version_id, -> { String }, optional: true, nullable: false
22
22
  field :price_behavior, -> { Schematic::Types::EntitlementPriceBehavior }, optional: true, nullable: false
23
23
  field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
24
+ field :quarterly_metered_price_id, -> { String }, optional: true, nullable: false
25
+ field :quarterly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
26
+ field :quarterly_unit_price, -> { Integer }, optional: true, nullable: false
27
+ field :quarterly_unit_price_decimal, -> { String }, optional: true, nullable: false
24
28
  field :soft_limit, -> { Integer }, optional: true, nullable: false
25
29
  field :tier_mode, -> { Schematic::Types::BillingTiersMode }, optional: true, nullable: false
26
30
  field :value_bool, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -10,6 +10,7 @@ module Schematic
10
10
  field :feature_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
11
11
  field :include_usage_aggregation, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
12
  field :limit, -> { Integer }, optional: true, nullable: false
13
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
13
14
  field :offset, -> { Integer }, optional: true, nullable: false
14
15
  field :q, -> { String }, optional: true, nullable: false
15
16
  field :without_negative_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -8,6 +8,7 @@ module Schematic
8
8
  field :company_keys, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
9
9
  field :feature_ids, -> { String }, optional: true, nullable: false
10
10
  field :include_usage_aggregation, -> { Internal::Types::Boolean }, optional: true, nullable: false
11
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
11
12
  field :q, -> { String }, optional: true, nullable: false
12
13
  field :without_negative_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
14
  field :limit, -> { Integer }, optional: true, nullable: false
@@ -19,6 +19,10 @@ module Schematic
19
19
  field :overage_billing_product_id, -> { String }, optional: true, nullable: false
20
20
  field :price_behavior, -> { Schematic::Types::EntitlementPriceBehavior }, optional: true, nullable: false
21
21
  field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
22
+ field :quarterly_metered_price_id, -> { String }, optional: true, nullable: false
23
+ field :quarterly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
24
+ field :quarterly_unit_price, -> { Integer }, optional: true, nullable: false
25
+ field :quarterly_unit_price_decimal, -> { String }, optional: true, nullable: false
22
26
  field :soft_limit, -> { Integer }, optional: true, nullable: false
23
27
  field :tier_mode, -> { Schematic::Types::BillingTiersMode }, optional: true, nullable: false
24
28
  field :value_bool, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -26,6 +26,7 @@ module Schematic
26
26
  @stopped = false
27
27
  @flushing = false
28
28
  @flush_done = ConditionVariable.new
29
+ @stop_cv = ConditionVariable.new
29
30
 
30
31
  start_periodic_flush unless @offline
31
32
  end
@@ -77,6 +78,10 @@ module Schematic
77
78
  @mutex.synchronize do
78
79
  @stopped = true
79
80
 
81
+ # Wake the periodic flush thread so it sees @stopped immediately
82
+ # instead of sleeping out the rest of @interval.
83
+ @stop_cv.broadcast
84
+
80
85
  # Wait for any in-flight flush to complete before our final flush,
81
86
  # so we don't skip events that arrived during the in-flight batch.
82
87
  @flush_done.wait(@mutex, 30) if @flushing
@@ -92,8 +97,11 @@ module Schematic
92
97
  def start_periodic_flush
93
98
  @flush_thread = Thread.new do
94
99
  loop do
95
- sleep(@interval)
96
- break if @stopped
100
+ should_break = @mutex.synchronize do
101
+ @stop_cv.wait(@mutex, @interval) unless @stopped
102
+ @stopped
103
+ end
104
+ break if should_break
97
105
 
98
106
  begin
99
107
  flush
@@ -97,6 +97,7 @@ module Schematic
97
97
  # @option params [String, nil] :event_subtype
98
98
  # @option params [Schematic::Types::EventType, nil] :event_types
99
99
  # @option params [String, nil] :flag_id
100
+ # @option params [String, nil] :idempotency_key
100
101
  # @option params [String, nil] :user_id
101
102
  # @option params [Integer, nil] :limit
102
103
  # @option params [Integer, nil] :offset
@@ -104,12 +105,13 @@ module Schematic
104
105
  # @return [Schematic::Events::Types::ListEventsResponse]
105
106
  def list_events(request_options: {}, **params)
106
107
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
107
- query_param_names = %i[company_id event_subtype event_types flag_id user_id limit offset]
108
+ query_param_names = %i[company_id event_subtype event_types flag_id idempotency_key user_id limit offset]
108
109
  query_params = {}
109
110
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
110
111
  query_params["event_subtype"] = params[:event_subtype] if params.key?(:event_subtype)
111
112
  query_params["event_types"] = params[:event_types] if params.key?(:event_types)
112
113
  query_params["flag_id"] = params[:flag_id] if params.key?(:flag_id)
114
+ query_params["idempotency_key"] = params[:idempotency_key] if params.key?(:idempotency_key)
113
115
  query_params["user_id"] = params[:user_id] if params.key?(:user_id)
114
116
  query_params["limit"] = params[:limit] if params.key?(:limit)
115
117
  query_params["offset"] = params[:offset] if params.key?(:offset)
@@ -9,6 +9,7 @@ module Schematic
9
9
  field :event_subtype, -> { String }, optional: true, nullable: false
10
10
  field :event_types, -> { Internal::Types::Array[Schematic::Types::EventType] }, optional: true, nullable: false
11
11
  field :flag_id, -> { String }, optional: true, nullable: false
12
+ field :idempotency_key, -> { String }, optional: true, nullable: false
12
13
  field :limit, -> { Integer }, optional: true, nullable: false
13
14
  field :offset, -> { Integer }, optional: true, nullable: false
14
15
  field :user_id, -> { String }, optional: true, nullable: false
@@ -8,6 +8,7 @@ module Schematic
8
8
  field :event_subtype, -> { String }, optional: true, nullable: false
9
9
  field :event_types, -> { Schematic::Types::EventType }, optional: true, nullable: false
10
10
  field :flag_id, -> { String }, optional: true, nullable: false
11
+ field :idempotency_key, -> { String }, optional: true, nullable: false
11
12
  field :user_id, -> { String }, optional: true, nullable: false
12
13
  field :limit, -> { Integer }, optional: true, nullable: false
13
14
  field :offset, -> { Integer }, optional: true, nullable: false
@@ -20,6 +20,7 @@ module Schematic
20
20
  # @option params [Boolean, nil] :boolean_require_event
21
21
  # @option params [Schematic::Types::FeatureType, nil] :feature_type
22
22
  # @option params [String, nil] :ids
23
+ # @option params [Schematic::Types::BillingProviderType, nil] :managed_by
23
24
  # @option params [String, nil] :plan_version_id
24
25
  # @option params [String, nil] :q
25
26
  # @option params [String, nil] :without_company_override_for
@@ -30,11 +31,12 @@ module Schematic
30
31
  # @return [Schematic::Features::Types::ListFeaturesResponse]
31
32
  def list_features(request_options: {}, **params)
32
33
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
33
- query_param_names = %i[boolean_require_event feature_type ids plan_version_id q without_company_override_for without_plan_entitlement_for limit offset]
34
+ query_param_names = %i[boolean_require_event feature_type ids managed_by plan_version_id q without_company_override_for without_plan_entitlement_for limit offset]
34
35
  query_params = {}
35
36
  query_params["boolean_require_event"] = params[:boolean_require_event] if params.key?(:boolean_require_event)
36
37
  query_params["feature_type"] = params[:feature_type] if params.key?(:feature_type)
37
38
  query_params["ids"] = params[:ids] if params.key?(:ids)
39
+ query_params["managed_by"] = params[:managed_by] if params.key?(:managed_by)
38
40
  query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
39
41
  query_params["q"] = params[:q] if params.key?(:q)
40
42
  query_params["without_company_override_for"] = params[:without_company_override_for] if params.key?(:without_company_override_for)
@@ -239,6 +241,7 @@ module Schematic
239
241
  # @option params [Boolean, nil] :boolean_require_event
240
242
  # @option params [Schematic::Types::FeatureType, nil] :feature_type
241
243
  # @option params [String, nil] :ids
244
+ # @option params [Schematic::Types::BillingProviderType, nil] :managed_by
242
245
  # @option params [String, nil] :plan_version_id
243
246
  # @option params [String, nil] :q
244
247
  # @option params [String, nil] :without_company_override_for
@@ -249,11 +252,12 @@ module Schematic
249
252
  # @return [Schematic::Features::Types::CountFeaturesResponse]
250
253
  def count_features(request_options: {}, **params)
251
254
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
252
- query_param_names = %i[boolean_require_event feature_type ids plan_version_id q without_company_override_for without_plan_entitlement_for limit offset]
255
+ query_param_names = %i[boolean_require_event feature_type ids managed_by plan_version_id q without_company_override_for without_plan_entitlement_for limit offset]
253
256
  query_params = {}
254
257
  query_params["boolean_require_event"] = params[:boolean_require_event] if params.key?(:boolean_require_event)
255
258
  query_params["feature_type"] = params[:feature_type] if params.key?(:feature_type)
256
259
  query_params["ids"] = params[:ids] if params.key?(:ids)
260
+ query_params["managed_by"] = params[:managed_by] if params.key?(:managed_by)
257
261
  query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
258
262
  query_params["q"] = params[:q] if params.key?(:q)
259
263
  query_params["without_company_override_for"] = params[:without_company_override_for] if params.key?(:without_company_override_for)
@@ -9,6 +9,7 @@ module Schematic
9
9
  field :feature_type, -> { Internal::Types::Array[Schematic::Types::FeatureType] }, optional: true, nullable: false
10
10
  field :ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
11
11
  field :limit, -> { Integer }, optional: true, nullable: false
12
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
12
13
  field :offset, -> { Integer }, optional: true, nullable: false
13
14
  field :plan_version_id, -> { String }, optional: true, nullable: false
14
15
  field :q, -> { String }, optional: true, nullable: false
@@ -7,6 +7,7 @@ module Schematic
7
7
  field :boolean_require_event, -> { Internal::Types::Boolean }, optional: true, nullable: false
8
8
  field :feature_type, -> { Schematic::Types::FeatureType }, optional: true, nullable: false
9
9
  field :ids, -> { String }, optional: true, nullable: false
10
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
10
11
  field :plan_version_id, -> { String }, optional: true, nullable: false
11
12
  field :q, -> { String }, optional: true, nullable: false
12
13
  field :without_company_override_for, -> { String }, optional: true, nullable: false
@@ -9,6 +9,7 @@ module Schematic
9
9
  field :feature_type, -> { Internal::Types::Array[Schematic::Types::FeatureType] }, optional: true, nullable: false
10
10
  field :ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
11
11
  field :limit, -> { Integer }, optional: true, nullable: false
12
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
12
13
  field :offset, -> { Integer }, optional: true, nullable: false
13
14
  field :plan_version_id, -> { String }, optional: true, nullable: false
14
15
  field :q, -> { String }, optional: true, nullable: false
@@ -7,6 +7,7 @@ module Schematic
7
7
  field :boolean_require_event, -> { Internal::Types::Boolean }, optional: true, nullable: false
8
8
  field :feature_type, -> { Schematic::Types::FeatureType }, optional: true, nullable: false
9
9
  field :ids, -> { String }, optional: true, nullable: false
10
+ field :managed_by, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
10
11
  field :plan_version_id, -> { String }, optional: true, nullable: false
11
12
  field :q, -> { String }, optional: true, nullable: false
12
13
  field :without_company_override_for, -> { String }, optional: true, nullable: false