schematichq 1.4.16 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -4
  3. data/.fern/replay.lock +21 -3
  4. data/.fernignore +1 -0
  5. data/CONTRIBUTING.md +2 -2
  6. data/README.md +23 -0
  7. data/WASM_VERSION +1 -1
  8. data/lib/schematic/accesstokens/client.rb +1 -1
  9. data/lib/schematic/accounts/client.rb +21 -21
  10. data/lib/schematic/accounts/types/update_onboarding_state_request_body.rb +2 -0
  11. data/lib/schematic/billing/client.rb +120 -24
  12. data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +2 -0
  13. data/lib/schematic/billing/types/list_company_billing_profiles_params.rb +20 -0
  14. data/lib/schematic/billing/types/list_company_billing_profiles_request.rb +19 -0
  15. data/lib/schematic/billing/types/list_company_billing_profiles_response.rb +13 -0
  16. data/lib/schematic/billing/types/update_company_billing_profile_request_body.rb +23 -0
  17. data/lib/schematic/billing/types/update_company_billing_profile_response.rb +13 -0
  18. data/lib/schematic/catalogs/client.rb +10 -10
  19. data/lib/schematic/checkout/client.rb +9 -9
  20. data/lib/schematic/client.rb +1 -1
  21. data/lib/schematic/companies/client.rb +43 -43
  22. data/lib/schematic/components/client.rb +8 -8
  23. data/lib/schematic/componentspublic/client.rb +1 -1
  24. data/lib/schematic/credits/client.rb +372 -41
  25. data/lib/schematic/credits/types/count_credit_spend_policies_params.rb +24 -0
  26. data/lib/schematic/credits/types/count_credit_spend_policies_request.rb +23 -0
  27. data/lib/schematic/credits/types/count_credit_spend_policies_response.rb +13 -0
  28. data/lib/schematic/credits/types/create_company_credit_grant.rb +2 -0
  29. data/lib/schematic/credits/types/create_credit_spend_policy_request_body.rb +19 -0
  30. data/lib/schematic/credits/types/create_credit_spend_policy_response.rb +13 -0
  31. data/lib/schematic/credits/types/delete_credit_spend_policy_response.rb +13 -0
  32. data/lib/schematic/credits/types/get_credit_spend_policy_response.rb +13 -0
  33. data/lib/schematic/credits/types/list_credit_spend_policies_params.rb +24 -0
  34. data/lib/schematic/credits/types/list_credit_spend_policies_request.rb +23 -0
  35. data/lib/schematic/credits/types/list_credit_spend_policies_response.rb +13 -0
  36. data/lib/schematic/credits/types/release_credit_reservation_response.rb +13 -0
  37. data/lib/schematic/credits/types/reserve_credits_request_body.rb +19 -0
  38. data/lib/schematic/credits/types/reserve_credits_response.rb +13 -0
  39. data/lib/schematic/credits/types/update_credit_spend_policy_request_body.rb +15 -0
  40. data/lib/schematic/credits/types/update_credit_spend_policy_response.rb +13 -0
  41. data/lib/schematic/dataexports/client.rb +3 -3
  42. data/lib/schematic/datastream/client.rb +5 -2
  43. data/lib/schematic/datastream/resource_cache.rb +2 -4
  44. data/lib/schematic/datastream/websocket_client.rb +59 -1
  45. data/lib/schematic/entitlements/client.rb +25 -25
  46. data/lib/schematic/events/client.rb +107 -6
  47. data/lib/schematic/events/types/delete_otlp_environment_settings_response.rb +13 -0
  48. data/lib/schematic/events/types/get_otlp_environment_settings_response.rb +13 -0
  49. data/lib/schematic/events/types/upsert_otlp_environment_settings_request_body.rb +19 -0
  50. data/lib/schematic/events/types/upsert_otlp_environment_settings_response.rb +13 -0
  51. data/lib/schematic/features/client.rb +57 -17
  52. data/lib/schematic/features/types/check_and_reserve_flag_request_body.rb +21 -0
  53. data/lib/schematic/features/types/check_and_reserve_flag_response.rb +13 -0
  54. data/lib/schematic/insights/client.rb +6 -6
  55. data/lib/schematic/integrationsapi/client.rb +178 -9
  56. data/lib/schematic/integrationsapi/types/claim_stripe_sandbox_keys_request_body.rb +11 -0
  57. data/lib/schematic/integrationsapi/types/claim_stripe_sandbox_keys_response.rb +13 -0
  58. data/lib/schematic/integrationsapi/types/get_stripe_sandbox_claim_link_response.rb +13 -0
  59. data/lib/schematic/integrationsapi/types/get_stripe_sandbox_keys_response.rb +13 -0
  60. data/lib/schematic/integrationsapi/types/install_stripe_claimable_sandbox_response.rb +13 -0
  61. data/lib/schematic/integrationsapi/types/install_stripe_sandbox_request_body.rb +17 -0
  62. data/lib/schematic/integrationsapi/types/list_stripe_sandbox_countries_response.rb +13 -0
  63. data/lib/schematic/internal/multipart/multipart_form_data.rb +8 -3
  64. data/lib/schematic/internal/types/model.rb +14 -6
  65. data/lib/schematic/licenses/client.rb +3 -3
  66. data/lib/schematic/planbundle/client.rb +3 -3
  67. data/lib/schematic/plangroups/client.rb +3 -3
  68. data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +2 -0
  69. data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +2 -0
  70. data/lib/schematic/planmigrations/client.rb +11 -11
  71. data/lib/schematic/plans/client.rb +24 -18
  72. data/lib/schematic/plans/types/count_plans_params.rb +2 -0
  73. data/lib/schematic/plans/types/count_plans_request.rb +2 -0
  74. data/lib/schematic/plans/types/list_plans_params.rb +2 -0
  75. data/lib/schematic/plans/types/list_plans_request.rb +2 -0
  76. data/lib/schematic/scheduledcheckout/client.rb +4 -4
  77. data/lib/schematic/schematic_client.rb +15 -2
  78. data/lib/schematic/types/billing_arrears_anchor.rb +12 -0
  79. data/lib/schematic/types/billing_arrears_cadence.rb +12 -0
  80. data/lib/schematic/types/billing_credit_grant_response_data.rb +8 -0
  81. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +12 -0
  82. data/lib/schematic/types/check_and_reserve_flag_response_data.rb +39 -0
  83. data/lib/schematic/types/checkout_data_response_data.rb +4 -0
  84. data/lib/schematic/types/claimed_stripe_sandbox_keys_response_data.rb +13 -0
  85. data/lib/schematic/types/company_billing_profile_response_data.rb +35 -0
  86. data/lib/schematic/types/company_detail_response_data.rb +4 -0
  87. data/lib/schematic/types/company_override_response_data.rb +4 -0
  88. data/lib/schematic/types/company_plan_credit_grant_view.rb +12 -0
  89. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +12 -0
  90. data/lib/schematic/types/credit_company_grant_view.rb +14 -0
  91. data/lib/schematic/types/credit_reservation_response_data.rb +25 -0
  92. data/lib/schematic/types/credit_spend_policy_response_data.rb +25 -0
  93. data/lib/schematic/types/credit_spend_policy_scope.rb +13 -0
  94. data/lib/schematic/types/credit_usage_reason.rb +2 -0
  95. data/lib/schematic/types/event_body_inference.rb +2 -0
  96. data/lib/schematic/types/event_body_track.rb +2 -0
  97. data/lib/schematic/types/event_detail_response_data.rb +2 -0
  98. data/lib/schematic/types/event_response_data.rb +2 -0
  99. data/lib/schematic/types/flag_check_reservation_response_data.rb +23 -0
  100. data/lib/schematic/types/get_onboarding_state_resp.rb +6 -0
  101. data/lib/schematic/types/issue_temporary_access_token_response_data.rb +3 -1
  102. data/lib/schematic/types/onboarding_requirement.rb +1 -0
  103. data/lib/schematic/types/onboarding_roadmap_view.rb +11 -0
  104. data/lib/schematic/types/otlp_environment_settings_response_data.rb +23 -0
  105. data/lib/schematic/types/plan_credit_grant_view.rb +12 -0
  106. data/lib/schematic/types/plan_group_detail_response_data.rb +2 -0
  107. data/lib/schematic/types/plan_group_response_data.rb +2 -0
  108. data/lib/schematic/types/rule_condition_detail_response_data.rb +2 -0
  109. data/lib/schematic/types/rule_condition_plan_version_response_data.rb +15 -0
  110. data/lib/schematic/types/rules_engine_schema_version.rb +1 -1
  111. data/lib/schematic/types/rulesengine_company.rb +2 -0
  112. data/lib/schematic/types/rulesengine_credit_postpaid_config.rb +9 -0
  113. data/lib/schematic/types/slack_connect_invite_status.rb +15 -0
  114. data/lib/schematic/types/slack_connect_invite_view.rb +15 -0
  115. data/lib/schematic/types/stripe_integration_config.rb +6 -0
  116. data/lib/schematic/types/stripe_sandbox_claim_link.rb +15 -0
  117. data/lib/schematic/types/stripe_sandbox_countries_response_data.rb +9 -0
  118. data/lib/schematic/types/stripe_sandbox_install_response_data.rb +21 -0
  119. data/lib/schematic/types/stripe_sandbox_keys_response_data.rb +13 -0
  120. data/lib/schematic/types/temporary_access_token_issuer_type.rb +12 -0
  121. data/lib/schematic/types/temporary_access_token_response_data.rb +3 -1
  122. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +12 -0
  123. data/lib/schematic/types/webhook_event_detail_response_data.rb +2 -0
  124. data/lib/schematic/types/webhook_event_response_data.rb +2 -0
  125. data/lib/schematic/version.rb +1 -1
  126. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  127. data/lib/schematic/webhooks/client.rb +10 -10
  128. data/lib/schematic.rb +56 -4
  129. data/reference.md +1345 -44
  130. data/testapp/app.rb +13 -2
  131. metadata +55 -3
  132. data/lib/schematic/types/release_credit_lease_request_body.rb +0 -23
@@ -46,7 +46,7 @@ module Schematic
46
46
  end
47
47
  code = response.code.to_i
48
48
  if code.between?(200, 299)
49
- Schematic::Plans::Types::UpdateCompanyPlansResponse.load(response.body)
49
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpdateCompanyPlansResponse.load(response.body))
50
50
  else
51
51
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
52
52
  raise error_class.new(response.body, code: code)
@@ -105,7 +105,7 @@ module Schematic
105
105
  end
106
106
  code = response.code.to_i
107
107
  if code.between?(200, 299)
108
- Schematic::Plans::Types::ListCustomPlanBillingsResponse.load(response.body)
108
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListCustomPlanBillingsResponse.load(response.body))
109
109
  else
110
110
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
111
111
  raise error_class.new(response.body, code: code)
@@ -149,7 +149,7 @@ module Schematic
149
149
  end
150
150
  code = response.code.to_i
151
151
  if code.between?(200, 299)
152
- Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse.load(response.body)
152
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse.load(response.body))
153
153
  else
154
154
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
155
155
  raise error_class.new(response.body, code: code)
@@ -192,7 +192,7 @@ module Schematic
192
192
  end
193
193
  code = response.code.to_i
194
194
  if code.between?(200, 299)
195
- Schematic::Plans::Types::RetryCustomPlanBillingResponse.load(response.body)
195
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::RetryCustomPlanBillingResponse.load(response.body))
196
196
  else
197
197
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
198
198
  raise error_class.new(response.body, code: code)
@@ -230,7 +230,7 @@ module Schematic
230
230
  end
231
231
  code = response.code.to_i
232
232
  if code.between?(200, 299)
233
- Schematic::Plans::Types::CreateCustomPlanResponse.load(response.body)
233
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CreateCustomPlanResponse.load(response.body))
234
234
  else
235
235
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
236
236
  raise error_class.new(response.body, code: code)
@@ -247,6 +247,7 @@ module Schematic
247
247
  # @option params [String, nil] :company_id
248
248
  # @option params [Boolean, nil] :company_scoped_only
249
249
  # @option params [Boolean, nil] :exclude_company_scoped
250
+ # @option params [Boolean, nil] :exclude_unused
250
251
  # @option params [Boolean, nil] :for_fallback_plan
251
252
  # @option params [Boolean, nil] :for_initial_plan
252
253
  # @option params [Boolean, nil] :for_trial_expiry_plan
@@ -267,6 +268,7 @@ module Schematic
267
268
  # company_id: "company_id",
268
269
  # company_scoped_only: true,
269
270
  # exclude_company_scoped: true,
271
+ # exclude_unused: true,
270
272
  # for_fallback_plan: true,
271
273
  # for_initial_plan: true,
272
274
  # for_trial_expiry_plan: true,
@@ -290,6 +292,7 @@ module Schematic
290
292
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
291
293
  query_params["company_scoped_only"] = params[:company_scoped_only] if params.key?(:company_scoped_only)
292
294
  query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
295
+ query_params["exclude_unused"] = params[:exclude_unused] if params.key?(:exclude_unused)
293
296
  query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
294
297
  query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
295
298
  query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
@@ -319,7 +322,7 @@ module Schematic
319
322
  end
320
323
  code = response.code.to_i
321
324
  if code.between?(200, 299)
322
- Schematic::Plans::Types::ListPlansResponse.load(response.body)
325
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListPlansResponse.load(response.body))
323
326
  else
324
327
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
325
328
  raise error_class.new(response.body, code: code)
@@ -357,7 +360,7 @@ module Schematic
357
360
  end
358
361
  code = response.code.to_i
359
362
  if code.between?(200, 299)
360
- Schematic::Plans::Types::CreatePlanResponse.load(response.body)
363
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CreatePlanResponse.load(response.body))
361
364
  else
362
365
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
363
366
  raise error_class.new(response.body, code: code)
@@ -400,7 +403,7 @@ module Schematic
400
403
  end
401
404
  code = response.code.to_i
402
405
  if code.between?(200, 299)
403
- Schematic::Plans::Types::GetPlanResponse.load(response.body)
406
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::GetPlanResponse.load(response.body))
404
407
  else
405
408
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
406
409
  raise error_class.new(response.body, code: code)
@@ -442,7 +445,7 @@ module Schematic
442
445
  end
443
446
  code = response.code.to_i
444
447
  if code.between?(200, 299)
445
- Schematic::Plans::Types::UpdatePlanResponse.load(response.body)
448
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpdatePlanResponse.load(response.body))
446
449
  else
447
450
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
448
451
  raise error_class.new(response.body, code: code)
@@ -477,7 +480,7 @@ module Schematic
477
480
  end
478
481
  code = response.code.to_i
479
482
  if code.between?(200, 299)
480
- Schematic::Plans::Types::DeletePlanResponse.load(response.body)
483
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::DeletePlanResponse.load(response.body))
481
484
  else
482
485
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
483
486
  raise error_class.new(response.body, code: code)
@@ -520,7 +523,7 @@ module Schematic
520
523
  end
521
524
  code = response.code.to_i
522
525
  if code.between?(200, 299)
523
- Schematic::Plans::Types::UpsertBillingProductPlanResponse.load(response.body)
526
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpsertBillingProductPlanResponse.load(response.body))
524
527
  else
525
528
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
526
529
  raise error_class.new(response.body, code: code)
@@ -560,7 +563,7 @@ module Schematic
560
563
  end
561
564
  code = response.code.to_i
562
565
  if code.between?(200, 299)
563
- Schematic::Plans::Types::UpsertPlanForBillingProductResponse.load(response.body)
566
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::UpsertPlanForBillingProductResponse.load(response.body))
564
567
  else
565
568
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
566
569
  raise error_class.new(response.body, code: code)
@@ -610,7 +613,7 @@ module Schematic
610
613
  end
611
614
  code = response.code.to_i
612
615
  if code.between?(200, 299)
613
- Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse.load(response.body)
616
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse.load(response.body))
614
617
  else
615
618
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
616
619
  raise error_class.new(response.body, code: code)
@@ -660,7 +663,7 @@ module Schematic
660
663
  end
661
664
  code = response.code.to_i
662
665
  if code.between?(200, 299)
663
- Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse.load(response.body)
666
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse.load(response.body))
664
667
  else
665
668
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
666
669
  raise error_class.new(response.body, code: code)
@@ -677,6 +680,7 @@ module Schematic
677
680
  # @option params [String, nil] :company_id
678
681
  # @option params [Boolean, nil] :company_scoped_only
679
682
  # @option params [Boolean, nil] :exclude_company_scoped
683
+ # @option params [Boolean, nil] :exclude_unused
680
684
  # @option params [Boolean, nil] :for_fallback_plan
681
685
  # @option params [Boolean, nil] :for_initial_plan
682
686
  # @option params [Boolean, nil] :for_trial_expiry_plan
@@ -697,6 +701,7 @@ module Schematic
697
701
  # company_id: "company_id",
698
702
  # company_scoped_only: true,
699
703
  # exclude_company_scoped: true,
704
+ # exclude_unused: true,
700
705
  # for_fallback_plan: true,
701
706
  # for_initial_plan: true,
702
707
  # for_trial_expiry_plan: true,
@@ -720,6 +725,7 @@ module Schematic
720
725
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
721
726
  query_params["company_scoped_only"] = params[:company_scoped_only] if params.key?(:company_scoped_only)
722
727
  query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
728
+ query_params["exclude_unused"] = params[:exclude_unused] if params.key?(:exclude_unused)
723
729
  query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
724
730
  query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
725
731
  query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
@@ -749,7 +755,7 @@ module Schematic
749
755
  end
750
756
  code = response.code.to_i
751
757
  if code.between?(200, 299)
752
- Schematic::Plans::Types::CountPlansResponse.load(response.body)
758
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::CountPlansResponse.load(response.body))
753
759
  else
754
760
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
755
761
  raise error_class.new(response.body, code: code)
@@ -793,7 +799,7 @@ module Schematic
793
799
  end
794
800
  code = response.code.to_i
795
801
  if code.between?(200, 299)
796
- Schematic::Plans::Types::ListPlanIssuesResponse.load(response.body)
802
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::ListPlanIssuesResponse.load(response.body))
797
803
  else
798
804
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
799
805
  raise error_class.new(response.body, code: code)
@@ -836,7 +842,7 @@ module Schematic
836
842
  end
837
843
  code = response.code.to_i
838
844
  if code.between?(200, 299)
839
- Schematic::Plans::Types::DeletePlanVersionResponse.load(response.body)
845
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::DeletePlanVersionResponse.load(response.body))
840
846
  else
841
847
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
842
848
  raise error_class.new(response.body, code: code)
@@ -880,7 +886,7 @@ module Schematic
880
886
  end
881
887
  code = response.code.to_i
882
888
  if code.between?(200, 299)
883
- Schematic::Plans::Types::PublishPlanVersionResponse.load(response.body)
889
+ (response.body.to_s.empty? ? nil : Schematic::Plans::Types::PublishPlanVersionResponse.load(response.body))
884
890
  else
885
891
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
886
892
  raise error_class.new(response.body, code: code)
@@ -11,6 +11,8 @@ module Schematic
11
11
 
12
12
  field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
13
 
14
+ field :exclude_unused, -> { Internal::Types::Boolean }, optional: true, nullable: false
15
+
14
16
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
15
17
 
16
18
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -10,6 +10,8 @@ module Schematic
10
10
 
11
11
  field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
12
 
13
+ field :exclude_unused, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
+
13
15
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
16
 
15
17
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -11,6 +11,8 @@ module Schematic
11
11
 
12
12
  field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
13
13
 
14
+ field :exclude_unused, -> { Internal::Types::Boolean }, optional: true, nullable: false
15
+
14
16
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
15
17
 
16
18
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -10,6 +10,8 @@ module Schematic
10
10
 
11
11
  field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
12
 
13
+ field :exclude_unused, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
+
13
15
  field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
16
 
15
17
  field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -53,7 +53,7 @@ module Schematic
53
53
  end
54
54
  code = response.code.to_i
55
55
  if code.between?(200, 299)
56
- Schematic::Scheduledcheckout::Types::ListScheduledCheckoutsResponse.load(response.body)
56
+ (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::ListScheduledCheckoutsResponse.load(response.body))
57
57
  else
58
58
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
59
59
  raise error_class.new(response.body, code: code)
@@ -93,7 +93,7 @@ module Schematic
93
93
  end
94
94
  code = response.code.to_i
95
95
  if code.between?(200, 299)
96
- Schematic::Scheduledcheckout::Types::CreateScheduledCheckoutResponse.load(response.body)
96
+ (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::CreateScheduledCheckoutResponse.load(response.body))
97
97
  else
98
98
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
99
99
  raise error_class.new(response.body, code: code)
@@ -128,7 +128,7 @@ module Schematic
128
128
  end
129
129
  code = response.code.to_i
130
130
  if code.between?(200, 299)
131
- Schematic::Scheduledcheckout::Types::GetScheduledCheckoutResponse.load(response.body)
131
+ (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::GetScheduledCheckoutResponse.load(response.body))
132
132
  else
133
133
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
134
134
  raise error_class.new(response.body, code: code)
@@ -168,7 +168,7 @@ module Schematic
168
168
  end
169
169
  code = response.code.to_i
170
170
  if code.between?(200, 299)
171
- Schematic::Scheduledcheckout::Types::UpdateScheduledCheckoutResponse.load(response.body)
171
+ (response.body.to_s.empty? ? nil : Schematic::Scheduledcheckout::Types::UpdateScheduledCheckoutResponse.load(response.body))
172
172
  else
173
173
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
174
174
  raise error_class.new(response.body, code: code)
@@ -202,7 +202,7 @@ module Schematic
202
202
  cache_key = build_cache_key(key, company, user)
203
203
  found = false
204
204
  @flag_check_cache_providers.each do |provider|
205
- cached = provider.get(cache_key)
205
+ cached = coerce_cached_response(provider.get(cache_key))
206
206
  next unless cached
207
207
 
208
208
  cached_results[key] = { flag: key, value: cached.value, reason: cached.reason }
@@ -384,11 +384,20 @@ module Schematic
384
384
 
385
385
  # --- Internal Flag Checking ---
386
386
 
387
+ # Cache providers that serialize (RedisCacheProvider) hand back a Hash, not
388
+ # the CheckFlagResponse that was stored; the in-memory cache returns the
389
+ # object itself. Normalize so callers can use the response API either way.
390
+ def coerce_cached_response(cached)
391
+ return cached unless cached.is_a?(Hash)
392
+
393
+ CheckFlagResponse.new(cached)
394
+ end
395
+
387
396
  def check_flag_via_api(flag_key, company, user)
388
397
  # Check cache
389
398
  cache_key = build_cache_key(flag_key, company, user)
390
399
  @flag_check_cache_providers.each do |provider|
391
- cached = provider.get(cache_key)
400
+ cached = coerce_cached_response(provider.get(cache_key))
392
401
  if cached
393
402
  @logger.debug("Flag '#{flag_key}' found in cache (value=#{cached.value})")
394
403
  return cached
@@ -562,6 +571,10 @@ module Schematic
562
571
  replicator_health_interval: options[:replicator_health_interval] || DataStream::REPLICATOR_HEALTH_INTERVAL
563
572
  }
564
573
 
574
+ # Only forward an explicit frame-size limit; when unset the websocket gem's
575
+ # own default (20MB) applies and no global state is touched.
576
+ ds_opts[:max_frame_size] = options[:max_frame_size] if options[:max_frame_size]
577
+
565
578
  # Redis client convenience — auto-creates Redis cache providers
566
579
  ds_opts[:redis_client] = options[:redis_client] if options[:redis_client]
567
580
  ds_opts[:redis_key_prefix] = options[:redis_key_prefix] if options[:redis_key_prefix]
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ module BillingArrearsAnchor
6
+ extend Schematic::Internal::Types::Enum
7
+
8
+ BILLING_PERIOD_START = "billing_period_start"
9
+ MONTH_END = "month_end"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ module BillingArrearsCadence
6
+ extend Schematic::Internal::Types::Enum
7
+
8
+ END_OF_BILLING_PERIOD = "end_of_billing_period"
9
+ MONTHLY = "monthly"
10
+ end
11
+ end
12
+ end
@@ -11,6 +11,8 @@ module Schematic
11
11
 
12
12
  field :created_at, -> { String }, optional: false, nullable: false
13
13
 
14
+ field :credit_bundle_id, -> { String }, optional: true, nullable: false
15
+
14
16
  field :credit_icon, -> { String }, optional: true, nullable: false
15
17
 
16
18
  field :credit_id, -> { String }, optional: false, nullable: false
@@ -31,6 +33,12 @@ module Schematic
31
33
 
32
34
  field :plan_name, -> { String }, optional: true, nullable: false
33
35
 
36
+ field :postpaid_charge_amount, -> { Integer }, optional: true, nullable: false
37
+
38
+ field :postpaid_charge_currency, -> { String }, optional: true, nullable: false
39
+
40
+ field :postpaid_charged_credits, -> { Integer }, optional: true, nullable: false
41
+
34
42
  field :price, -> { Schematic::Types::BillingPriceResponseData }, optional: true, nullable: false
35
43
 
36
44
  field :quantity, -> { Integer }, optional: false, nullable: false
@@ -3,6 +3,10 @@
3
3
  module Schematic
4
4
  module Types
5
5
  class BillingPlanCreditGrantResponseData < Internal::Types::Model
6
+ field :arrears_anchor, -> { Schematic::Types::BillingArrearsAnchor }, optional: true, nullable: false
7
+
8
+ field :arrears_cadence, -> { Schematic::Types::BillingArrearsCadence }, optional: true, nullable: false
9
+
6
10
  field :auto_topup_amount, -> { Integer }, optional: true, nullable: false
7
11
 
8
12
  field :auto_topup_amount_type, -> { String }, optional: true, nullable: false
@@ -51,6 +55,8 @@ module Schematic
51
55
 
52
56
  field :license_id, -> { String }, optional: true, nullable: false
53
57
 
58
+ field :overdraft_limit, -> { Integer }, optional: true, nullable: false
59
+
54
60
  field :plan, -> { Schematic::Types::PreviewObjectResponseData }, optional: true, nullable: false
55
61
 
56
62
  field :plan_id, -> { String }, optional: false, nullable: false
@@ -59,6 +65,12 @@ module Schematic
59
65
 
60
66
  field :plan_version_id, -> { String }, optional: true, nullable: false
61
67
 
68
+ field :postpaid_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
69
+
70
+ field :postpaid_rate_per_unit, -> { Integer }, optional: true, nullable: false
71
+
72
+ field :postpaid_rate_per_unit_decimal, -> { String }, optional: true, nullable: false
73
+
62
74
  field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
63
75
 
64
76
  field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: true, nullable: false
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CheckAndReserveFlagResponseData < Internal::Types::Model
6
+ field :company_id, -> { String }, optional: true, nullable: false
7
+
8
+ field :entitlement, -> { Schematic::Types::FeatureEntitlement }, optional: true, nullable: false
9
+
10
+ field :error, -> { String }, optional: true, nullable: false
11
+
12
+ field :feature_allocation, -> { Integer }, optional: true, nullable: false
13
+
14
+ field :feature_usage, -> { Integer }, optional: true, nullable: false
15
+
16
+ field :feature_usage_event, -> { String }, optional: true, nullable: false
17
+
18
+ field :feature_usage_period, -> { Schematic::Types::MetricPeriod }, optional: true, nullable: false
19
+
20
+ field :feature_usage_reset_at, -> { String }, optional: true, nullable: false
21
+
22
+ field :flag, -> { String }, optional: false, nullable: false
23
+
24
+ field :flag_id, -> { String }, optional: true, nullable: false
25
+
26
+ field :reason, -> { String }, optional: false, nullable: false
27
+
28
+ field :reservation, -> { Schematic::Types::FlagCheckReservationResponseData }, optional: true, nullable: false
29
+
30
+ field :rule_id, -> { String }, optional: true, nullable: false
31
+
32
+ field :rule_type, -> { Schematic::Types::RuleType }, optional: true, nullable: false
33
+
34
+ field :user_id, -> { String }, optional: true, nullable: false
35
+
36
+ field :value, -> { Internal::Types::Boolean }, optional: false, nullable: false
37
+ end
38
+ end
39
+ end
@@ -13,6 +13,8 @@ module Schematic
13
13
 
14
14
  field :company, -> { Schematic::Types::CompanyDetailResponseData }, optional: true, nullable: false
15
15
 
16
+ field :company_can_trial_selected_plan, -> { Internal::Types::Boolean }, optional: false, nullable: false
17
+
16
18
  field :custom_checkout_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldWithValue] }, optional: false, nullable: false
17
19
 
18
20
  field :feature_usage, -> { Schematic::Types::FeatureUsageDetailResponseData }, optional: true, nullable: false
@@ -21,6 +23,8 @@ module Schematic
21
23
 
22
24
  field :selected_plan, -> { Schematic::Types::PlanDetailResponseData }, optional: true, nullable: false
23
25
 
26
+ field :selected_plan_already_trialed, -> { Internal::Types::Boolean }, optional: false, nullable: false
27
+
24
28
  field :selected_usage_based_entitlements, -> { Internal::Types::Array[Schematic::Types::UsageBasedEntitlementResponseData] }, optional: false, nullable: false
25
29
 
26
30
  field :subscription, -> { Schematic::Types::CompanySubscriptionResponseData }, optional: true, nullable: false
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class ClaimedStripeSandboxKeysResponseData < Internal::Types::Model
6
+ field :publishable, -> { String }, optional: false, nullable: false
7
+
8
+ field :sandbox_id, -> { String }, optional: false, nullable: false
9
+
10
+ field :secret, -> { String }, optional: false, nullable: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CompanyBillingProfileResponseData < Internal::Types::Model
6
+ field :account_id, -> { String }, optional: false, nullable: false
7
+
8
+ field :billing_customer_id, -> { String }, optional: true, nullable: false
9
+
10
+ field :collection_method, -> { Schematic::Types::BillingCollectionMethod }, optional: false, nullable: false
11
+
12
+ field :company_id, -> { String }, optional: false, nullable: false
13
+
14
+ field :created_at, -> { String }, optional: false, nullable: false
15
+
16
+ field :days_until_due, -> { Integer }, optional: true, nullable: false
17
+
18
+ field :environment_id, -> { String }, optional: false, nullable: false
19
+
20
+ field :id, -> { String }, optional: false, nullable: false
21
+
22
+ field :is_default, -> { Internal::Types::Boolean }, optional: false, nullable: false
23
+
24
+ field :name, -> { String }, optional: true, nullable: false
25
+
26
+ field :payment_method_id, -> { String }, optional: true, nullable: false
27
+
28
+ field :proration_behavior, -> { Schematic::Types::ProrationBehavior }, optional: true, nullable: false
29
+
30
+ field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
31
+
32
+ field :updated_at, -> { String }, optional: false, nullable: false
33
+ end
34
+ end
35
+ end
@@ -7,6 +7,10 @@ module Schematic
7
7
 
8
8
  field :billing_credit_balances, -> { Internal::Types::Hash[String, Integer] }, optional: true, nullable: false
9
9
 
10
+ field :billing_profile, -> { Schematic::Types::CompanyBillingProfileResponseData }, optional: true, nullable: false
11
+
12
+ field :billing_profiles, -> { Internal::Types::Array[Schematic::Types::CompanyBillingProfileResponseData] }, optional: true, nullable: false
13
+
10
14
  field :billing_subscription, -> { Schematic::Types::BillingSubscriptionView }, optional: true, nullable: false
11
15
 
12
16
  field :billing_subscriptions, -> { Internal::Types::Array[Schematic::Types::BillingSubscriptionView] }, optional: false, nullable: false
@@ -35,6 +35,10 @@ module Schematic
35
35
 
36
36
  field :value_bool, -> { Internal::Types::Boolean }, optional: true, nullable: false
37
37
 
38
+ field :value_credit, -> { Schematic::Types::BillingCreditResponseData }, optional: true, nullable: false
39
+
40
+ field :value_credit_id, -> { String }, optional: true, nullable: false
41
+
38
42
  field :value_numeric, -> { Integer }, optional: true, nullable: false
39
43
 
40
44
  field :value_trait, -> { Schematic::Types::EntityTraitDefinitionResponseData }, optional: true, nullable: false
@@ -3,6 +3,10 @@
3
3
  module Schematic
4
4
  module Types
5
5
  class CompanyPlanCreditGrantView < Internal::Types::Model
6
+ field :billing_credit_arrears_anchor, -> { Schematic::Types::BillingArrearsAnchor }, optional: true, nullable: false
7
+
8
+ field :billing_credit_arrears_cadence, -> { Schematic::Types::BillingArrearsCadence }, optional: true, nullable: false
9
+
6
10
  field :billing_credit_auto_topup_amount, -> { Integer }, optional: true, nullable: false
7
11
 
8
12
  field :billing_credit_auto_topup_amount_type, -> { String }, optional: true, nullable: false
@@ -25,6 +29,14 @@ module Schematic
25
29
 
26
30
  field :billing_credit_can_buy_bundles, -> { Internal::Types::Boolean }, optional: false, nullable: false
27
31
 
32
+ field :billing_credit_overdraft_limit, -> { Integer }, optional: true, nullable: false
33
+
34
+ field :billing_credit_postpaid_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
35
+
36
+ field :billing_credit_postpaid_rate_per_unit, -> { Integer }, optional: true, nullable: false
37
+
38
+ field :billing_credit_postpaid_rate_per_unit_decimal, -> { String }, optional: true, nullable: false
39
+
28
40
  field :company_auto_topup_amount, -> { Integer }, optional: true, nullable: false
29
41
 
30
42
  field :company_auto_topup_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -5,6 +5,10 @@ module Schematic
5
5
  class CreateBillingPlanCreditGrantRequestBody < Internal::Types::Model
6
6
  field :apply_to_existing, -> { Internal::Types::Boolean }, optional: true, nullable: false
7
7
 
8
+ field :arrears_anchor, -> { Schematic::Types::BillingArrearsAnchor }, optional: true, nullable: false
9
+
10
+ field :arrears_cadence, -> { Schematic::Types::BillingArrearsCadence }, optional: true, nullable: false
11
+
8
12
  field :auto_topup_amount, -> { Integer }, optional: true, nullable: false
9
13
 
10
14
  field :auto_topup_amount_type, -> { String }, optional: true, nullable: false
@@ -41,10 +45,18 @@ module Schematic
41
45
 
42
46
  field :license_id, -> { String }, optional: true, nullable: false
43
47
 
48
+ field :overdraft_limit, -> { Integer }, optional: true, nullable: false
49
+
44
50
  field :plan_id, -> { String }, optional: false, nullable: false
45
51
 
46
52
  field :plan_version_id, -> { String }, optional: true, nullable: false
47
53
 
54
+ field :postpaid_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
55
+
56
+ field :postpaid_rate_per_unit, -> { Integer }, optional: true, nullable: false
57
+
58
+ field :postpaid_rate_per_unit_decimal, -> { String }, optional: true, nullable: false
59
+
48
60
  field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: false, nullable: false
49
61
 
50
62
  field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: false, nullable: false
@@ -3,6 +3,8 @@
3
3
  module Schematic
4
4
  module Types
5
5
  class CreditCompanyGrantView < Internal::Types::Model
6
+ field :arrears_cadence, -> { Schematic::Types::BillingArrearsCadence }, optional: true, nullable: false
7
+
6
8
  field :billing_credit_bundle_id, -> { String }, optional: true, nullable: false
7
9
 
8
10
  field :billing_credit_id, -> { String }, optional: false, nullable: false
@@ -45,6 +47,18 @@ module Schematic
45
47
 
46
48
  field :plural_name, -> { String }, optional: true, nullable: false
47
49
 
50
+ field :postpaid_charge_amount, -> { Integer }, optional: true, nullable: false
51
+
52
+ field :postpaid_charge_currency, -> { String }, optional: true, nullable: false
53
+
54
+ field :postpaid_charged_credits, -> { Integer }, optional: true, nullable: false
55
+
56
+ field :postpaid_period_end, -> { String }, optional: true, nullable: false
57
+
58
+ field :postpaid_rate, -> { Integer }, optional: true, nullable: false
59
+
60
+ field :postpaid_rate_decimal, -> { String }, optional: true, nullable: false
61
+
48
62
  field :price, -> { Schematic::Types::BillingProductPriceResponseData }, optional: true, nullable: false
49
63
 
50
64
  field :quantity, -> { Integer }, optional: false, nullable: false
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Types
5
+ class CreditReservationResponseData < Internal::Types::Model
6
+ field :company_id, -> { String }, optional: false, nullable: false
7
+
8
+ field :created_at, -> { String }, optional: false, nullable: false
9
+
10
+ field :credit_type_id, -> { String }, optional: false, nullable: false
11
+
12
+ field :expires_at, -> { String }, optional: false, nullable: false
13
+
14
+ field :id, -> { String }, optional: false, nullable: false
15
+
16
+ field :released_at, -> { String }, optional: true, nullable: false
17
+
18
+ field :reserved_amount, -> { Integer }, optional: false, nullable: false
19
+
20
+ field :settled_amount, -> { Integer }, optional: false, nullable: false
21
+
22
+ field :updated_at, -> { String }, optional: false, nullable: false
23
+ end
24
+ end
25
+ end