schematichq 1.4.12 → 1.4.14

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +2 -2
  3. data/.fern/replay.lock +15 -3
  4. data/README.md +1 -1
  5. data/WASM_VERSION +1 -1
  6. data/lib/schematic/accounts/client.rb +63 -0
  7. data/lib/schematic/accounts/types/get_onboarding_state_response.rb +12 -0
  8. data/lib/schematic/accounts/types/update_onboarding_state_request_body.rb +14 -0
  9. data/lib/schematic/accounts/types/update_onboarding_state_response.rb +12 -0
  10. data/lib/schematic/client.rb +1 -1
  11. data/lib/schematic/companies/client.rb +185 -3
  12. data/lib/schematic/companies/types/count_entity_keys_params.rb +15 -0
  13. data/lib/schematic/companies/types/count_entity_keys_request.rb +14 -0
  14. data/lib/schematic/companies/types/count_entity_keys_response.rb +12 -0
  15. data/lib/schematic/companies/types/count_entity_traits_params.rb +15 -0
  16. data/lib/schematic/companies/types/count_entity_traits_request.rb +14 -0
  17. data/lib/schematic/companies/types/count_entity_traits_response.rb +12 -0
  18. data/lib/schematic/companies/types/delete_entity_key_definition_response.rb +12 -0
  19. data/lib/schematic/companies/types/delete_entity_trait_definition_response.rb +12 -0
  20. data/lib/schematic/companies/types/get_entity_trait_definition_usage_response.rb +12 -0
  21. data/lib/schematic/companies/types/list_plan_changes_params.rb +0 -1
  22. data/lib/schematic/companies/types/list_plan_changes_request.rb +0 -1
  23. data/lib/schematic/credits/types/create_credit_bundle_request_body.rb +1 -0
  24. data/lib/schematic/credits/types/update_credit_bundle_details_request_body.rb +1 -0
  25. data/lib/schematic/planbundle/client.rb +3 -3
  26. data/lib/schematic/planbundle/types/update_plan_bundle_request_body.rb +1 -1
  27. data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +2 -0
  28. data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +2 -0
  29. data/lib/schematic/planmigrations/types/create_migration_input.rb +4 -3
  30. data/lib/schematic/planmigrations/types/preview_migration_request_body.rb +2 -1
  31. data/lib/schematic/plans/client.rb +11 -9
  32. data/lib/schematic/plans/types/delete_plan_version_request.rb +1 -1
  33. data/lib/schematic/plans/types/list_custom_plan_billings_params.rb +1 -0
  34. data/lib/schematic/plans/types/list_custom_plan_billings_request.rb +1 -0
  35. data/lib/schematic/plans/types/publish_plan_version_request_body.rb +2 -1
  36. data/lib/schematic/plans/types/update_company_plans_request_body.rb +1 -1
  37. data/lib/schematic/types/billing_collection_method.rb +12 -0
  38. data/lib/schematic/types/billing_credit_bundle_response_data.rb +1 -0
  39. data/lib/schematic/types/billing_credit_bundle_view.rb +1 -0
  40. data/lib/schematic/types/billing_credit_grant_response_data.rb +2 -0
  41. data/lib/schematic/types/billing_credit_view.rb +1 -1
  42. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +1 -0
  43. data/lib/schematic/types/billing_product_record_response_data.rb +17 -0
  44. data/lib/schematic/types/checkout_bundle_purchase_behavior.rb +12 -0
  45. data/lib/schematic/types/checkout_settings_response_data.rb +2 -0
  46. data/lib/schematic/types/company_billing_checkout_settings.rb +1 -0
  47. data/lib/schematic/types/company_feature_usage_export_metadata.rb +6 -1
  48. data/lib/schematic/types/company_feature_usage_export_metadata_sort_order_direction.rb +12 -0
  49. data/lib/schematic/types/company_feature_usage_export_metadata_visible_columns_item.rb +14 -0
  50. data/lib/schematic/types/company_plan_credit_grant_view.rb +1 -0
  51. data/lib/schematic/types/component_checkout_settings.rb +2 -0
  52. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +1 -0
  53. data/lib/schematic/types/credit_company_grant_view.rb +2 -0
  54. data/lib/schematic/types/custom_plan_billing_response_data.rb +2 -0
  55. data/lib/schematic/types/data_export_metadata.rb +1 -0
  56. data/lib/schematic/types/data_export_type.rb +1 -0
  57. data/lib/schematic/types/entity_trait_definition_usage.rb +14 -0
  58. data/lib/schematic/types/event_export_metadata.rb +16 -0
  59. data/lib/schematic/types/event_export_metadata_event_types_item.rb +14 -0
  60. data/lib/schematic/types/feature_view.rb +1 -1
  61. data/lib/schematic/types/get_onboarding_state_resp.rb +14 -0
  62. data/lib/schematic/types/manage_plan_request.rb +7 -0
  63. data/lib/schematic/types/migration_proration_behavior.rb +12 -0
  64. data/lib/schematic/types/onboarding_milestone.rb +12 -0
  65. data/lib/schematic/types/onboarding_milestone_view.rb +12 -0
  66. data/lib/schematic/types/onboarding_path.rb +12 -0
  67. data/lib/schematic/types/onboarding_requirement.rb +16 -0
  68. data/lib/schematic/types/onboarding_requirement_status.rb +13 -0
  69. data/lib/schematic/types/onboarding_requirement_view.rb +12 -0
  70. data/lib/schematic/types/onboarding_track.rb +12 -0
  71. data/lib/schematic/types/plan_billing_source.rb +12 -0
  72. data/lib/schematic/types/plan_bundle_response_data.rb +1 -0
  73. data/lib/schematic/types/plan_credit_grant_view.rb +1 -0
  74. data/lib/schematic/types/plan_version_migration_preview_response_data.rb +1 -0
  75. data/lib/schematic/types/plan_version_migration_response_data.rb +1 -0
  76. data/lib/schematic/types/preview_subscription_finance_response_data.rb +1 -0
  77. data/lib/schematic/types/test_webhook_response_data.rb +1 -0
  78. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +1 -0
  79. data/lib/schematic/types/upsert_company_request_body.rb +1 -0
  80. data/lib/schematic/types/upsert_user_request_body.rb +1 -0
  81. data/lib/schematic/types/upsert_user_sub_request_body.rb +1 -0
  82. data/lib/schematic/types/who_am_i_response_data.rb +1 -0
  83. data/lib/schematic/version.rb +1 -1
  84. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  85. data/lib/schematic.rb +30 -0
  86. data/reference.md +507 -25
  87. metadata +32 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bee308305df6ae2bdceab646e7829b09ece5d767cb302c6c978997f97c1e9bf
4
- data.tar.gz: 030c6a99cd7125ccabbfd07c6255ee4a95767e931e11a063c82574eb8f50362d
3
+ metadata.gz: 53f25b95e0e3d5093612fa858644502bb95dd1ef3169165aa150b0a70d09840d
4
+ data.tar.gz: b402ed5695207946b63d65e928a28a57d1c3b3b89dd4356c6203520d870b996b
5
5
  SHA512:
6
- metadata.gz: 1edd9a610f4dd418f16e5fbccab154a711e2b2d8d4d72c9c9c0d90b24ae8e23eddfb373bc9b4299a6bb8885585a0250edfa71e5c0e7c4441de5095275bf59c97
7
- data.tar.gz: 8fb4d4546c3a0eddeee495d9bc6dd1de45259b32e60e7eb297eeba5d69a4fc4e12c496d143ad63f84258556baf601bfb4658f629c28e254e69c669852bdf1000
6
+ metadata.gz: e181a61dc6e7b6181a0695e5d097ac80860a20a5fd61bb355055c27ec04270814d0b308193588130702191a57ee74d2742052648b1d7fa3ed63ea438cdd86cd6
7
+ data.tar.gz: 5fea6bbdfc528cfb9c3973385e3c8e749a7103b9ec8b6803722a88a26dcc0ebfc9e78ff9636f2d82dccdc936e3e813ff5ba6cc53989d8df1c36a0f64ea71aebc
data/.fern/metadata.json CHANGED
@@ -13,6 +13,6 @@
13
13
  "webrick": ">= 1.0"
14
14
  }
15
15
  },
16
- "originGitCommit": "a9fc73b97dcfa602bff97a7d41d980a55c9c9030",
17
- "sdkVersion": "1.4.12"
16
+ "originGitCommit": "1ab5d36abb4de887dde605f8b82a71dce464a26b",
17
+ "sdkVersion": "1.4.14"
18
18
  }
data/.fern/replay.lock CHANGED
@@ -54,14 +54,26 @@ generations:
54
54
  cli_version: unknown
55
55
  generator_versions:
56
56
  fernapi/fern-ruby-sdk: 1.1.13
57
- current_generation: 4c98e0c88a5af9323ad047925ea28dec7a8bf762
57
+ - commit_sha: 08bb53f51fc9cf2cc4e0b0b303167d8d1e6fbf0e
58
+ tree_hash: 4d178b386600e95e5e5d3a0e8eca8f586421d8ec
59
+ timestamp: 2026-08-10T10:28:58.021Z
60
+ cli_version: unknown
61
+ generator_versions:
62
+ fernapi/fern-ruby-sdk: 1.1.13
63
+ - commit_sha: 25497874a46bed5955dc9fcb6effc4d6bfafea9b
64
+ tree_hash: 111ecbe19a029b291a029131dffdff707a48d5af
65
+ timestamp: 2026-08-17T10:12:00.906Z
66
+ cli_version: unknown
67
+ generator_versions:
68
+ fernapi/fern-ruby-sdk: 1.1.13
69
+ current_generation: 25497874a46bed5955dc9fcb6effc4d6bfafea9b
58
70
  patches:
59
71
  - id: patch-5da692c2
60
72
  content_hash: sha256:e652287219a0a709e16112ced444e6472c6fa8bdfe888edf868caaf9769a9472
61
73
  original_commit: 5da692c20aef08577d900f9a860b5f78a549418e
62
74
  original_message: inject host time into datastream wasm rules engine (SCHY-471)
63
75
  original_author: Christopher Brady <chris@schematichq.com>
64
- base_generation: 4c98e0c88a5af9323ad047925ea28dec7a8bf762
76
+ base_generation: 25497874a46bed5955dc9fcb6effc4d6bfafea9b
65
77
  files:
66
78
  - test/rules_engine_clock_test.rb
67
79
  patch_content: |
@@ -229,7 +241,7 @@ patches:
229
241
  original_commit: ee61788c5a83fce5dd5768b2536391459550d176
230
242
  original_message: fix rubocop offenses in clock regression test (SCHY-471)
231
243
  original_author: Christopher Brady <chris@schematichq.com>
232
- base_generation: 4c98e0c88a5af9323ad047925ea28dec7a8bf762
244
+ base_generation: 25497874a46bed5955dc9fcb6effc4d6bfafea9b
233
245
  files:
234
246
  - test/rules_engine_clock_test.rb
235
247
  patch_content: |
data/README.md CHANGED
@@ -20,7 +20,7 @@ Then run:
20
20
  bundle install
21
21
  ```
22
22
 
23
- 2. [Issue an API key](https://docs.schematichq.com/quickstart#create-an-api-key) for the appropriate environment using the [Schematic app](https://app.schematichq.com/settings/api-keys). Be sure to capture the secret key when you issue the API key; you'll only see this key once, and this is what you'll use with schematic-ruby.
23
+ 2. [Issue an API key](https://docs.schematichq.com/quickstart/account-setup#2-create-your-api-keys) for the appropriate environment using the [Schematic app](https://app.schematichq.com/settings/api-keys). Be sure to capture the secret key when you issue the API key; you'll only see this key once, and this is what you'll use with schematic-ruby.
24
24
 
25
25
  3. Using this secret key, initialize a client in your application:
26
26
 
data/WASM_VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
@@ -662,6 +662,69 @@ module Schematic
662
662
  end
663
663
  end
664
664
 
665
+ # @param request_options [Hash]
666
+ # @param params [Hash]
667
+ # @option request_options [String] :base_url
668
+ # @option request_options [Hash{String => Object}] :additional_headers
669
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
670
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
671
+ # @option request_options [Integer] :timeout_in_seconds
672
+ #
673
+ # @return [Schematic::Accounts::Types::GetOnboardingStateResponse]
674
+ def get_onboarding_state(request_options: {}, **params)
675
+ Schematic::Internal::Types::Utils.normalize_keys(params)
676
+ request = Schematic::Internal::JSON::Request.new(
677
+ base_url: request_options[:base_url],
678
+ method: "GET",
679
+ path: "onboarding-state",
680
+ request_options: request_options
681
+ )
682
+ begin
683
+ response = @client.send(request)
684
+ rescue Net::HTTPRequestTimeout
685
+ raise Schematic::Errors::TimeoutError
686
+ end
687
+ code = response.code.to_i
688
+ if code.between?(200, 299)
689
+ Schematic::Accounts::Types::GetOnboardingStateResponse.load(response.body)
690
+ else
691
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
692
+ raise error_class.new(response.body, code: code)
693
+ end
694
+ end
695
+
696
+ # @param request_options [Hash]
697
+ # @param params [Schematic::Accounts::Types::UpdateOnboardingStateRequestBody]
698
+ # @option request_options [String] :base_url
699
+ # @option request_options [Hash{String => Object}] :additional_headers
700
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
701
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
702
+ # @option request_options [Integer] :timeout_in_seconds
703
+ #
704
+ # @return [Schematic::Accounts::Types::UpdateOnboardingStateResponse]
705
+ def update_onboarding_state(request_options: {}, **params)
706
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
707
+ request = Schematic::Internal::JSON::Request.new(
708
+ base_url: request_options[:base_url],
709
+ method: "POST",
710
+ path: "onboarding-state",
711
+ body: Schematic::Accounts::Types::UpdateOnboardingStateRequestBody.new(params).to_h,
712
+ request_options: request_options
713
+ )
714
+ begin
715
+ response = @client.send(request)
716
+ rescue Net::HTTPRequestTimeout
717
+ raise Schematic::Errors::TimeoutError
718
+ end
719
+ code = response.code.to_i
720
+ if code.between?(200, 299)
721
+ Schematic::Accounts::Types::UpdateOnboardingStateResponse.load(response.body)
722
+ else
723
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
724
+ raise error_class.new(response.body, code: code)
725
+ end
726
+ end
727
+
665
728
  # @param request_options [Hash]
666
729
  # @param params [Hash]
667
730
  # @option request_options [String] :base_url
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Accounts
5
+ module Types
6
+ class GetOnboardingStateResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::GetOnboardingStateResp }, 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,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Accounts
5
+ module Types
6
+ class UpdateOnboardingStateRequestBody < Internal::Types::Model
7
+ field :path, -> { Schematic::Types::OnboardingPath }, optional: true, nullable: false
8
+ field :pricing_page_url, -> { String }, optional: true, nullable: false
9
+ field :track, -> { Schematic::Types::OnboardingTrack }, optional: true, nullable: false
10
+ field :website_url, -> { String }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Accounts
5
+ module Types
6
+ class UpdateOnboardingStateResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::GetOnboardingStateResp }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -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.12",
13
+ "User-Agent" => "schematichq/1.4.14",
14
14
  "X-Fern-Language" => "Ruby",
15
15
  "X-Schematic-Api-Key" => api_key.to_s
16
16
  }
@@ -681,6 +681,38 @@ module Schematic
681
681
  end
682
682
  end
683
683
 
684
+ # @param request_options [Hash]
685
+ # @param params [Hash]
686
+ # @option request_options [String] :base_url
687
+ # @option request_options [Hash{String => Object}] :additional_headers
688
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
689
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
690
+ # @option request_options [Integer] :timeout_in_seconds
691
+ # @option params [String] :entity_key_definition_id
692
+ #
693
+ # @return [Schematic::Companies::Types::DeleteEntityKeyDefinitionResponse]
694
+ def delete_entity_key_definition(request_options: {}, **params)
695
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
696
+ request = Schematic::Internal::JSON::Request.new(
697
+ base_url: request_options[:base_url],
698
+ method: "DELETE",
699
+ path: "entity-key-definitions/#{URI.encode_uri_component(params[:entity_key_definition_id].to_s)}",
700
+ request_options: request_options
701
+ )
702
+ begin
703
+ response = @client.send(request)
704
+ rescue Net::HTTPRequestTimeout
705
+ raise Schematic::Errors::TimeoutError
706
+ end
707
+ code = response.code.to_i
708
+ if code.between?(200, 299)
709
+ Schematic::Companies::Types::DeleteEntityKeyDefinitionResponse.load(response.body)
710
+ else
711
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
712
+ raise error_class.new(response.body, code: code)
713
+ end
714
+ end
715
+
684
716
  # @param request_options [Hash]
685
717
  # @param params [Hash]
686
718
  # @option request_options [String] :base_url
@@ -727,6 +759,50 @@ module Schematic
727
759
  end
728
760
  end
729
761
 
762
+ # @param request_options [Hash]
763
+ # @param params [Hash]
764
+ # @option request_options [String] :base_url
765
+ # @option request_options [Hash{String => Object}] :additional_headers
766
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
767
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
768
+ # @option request_options [Integer] :timeout_in_seconds
769
+ # @option params [String, nil] :definition_id
770
+ # @option params [Schematic::Types::EntityType, nil] :entity_type
771
+ # @option params [Integer, nil] :limit
772
+ # @option params [Integer, nil] :offset
773
+ #
774
+ # @return [Schematic::Companies::Types::CountEntityKeysResponse]
775
+ def count_entity_keys(request_options: {}, **params)
776
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
777
+ query_param_names = %i[definition_id entity_type limit offset]
778
+ query_params = {}
779
+ query_params["definition_id"] = params[:definition_id] if params.key?(:definition_id)
780
+ query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type)
781
+ query_params["limit"] = params[:limit] if params.key?(:limit)
782
+ query_params["offset"] = params[:offset] if params.key?(:offset)
783
+ params.except(*query_param_names)
784
+
785
+ request = Schematic::Internal::JSON::Request.new(
786
+ base_url: request_options[:base_url],
787
+ method: "GET",
788
+ path: "entity-keys/count",
789
+ query: query_params,
790
+ request_options: request_options
791
+ )
792
+ begin
793
+ response = @client.send(request)
794
+ rescue Net::HTTPRequestTimeout
795
+ raise Schematic::Errors::TimeoutError
796
+ end
797
+ code = response.code.to_i
798
+ if code.between?(200, 299)
799
+ Schematic::Companies::Types::CountEntityKeysResponse.load(response.body)
800
+ else
801
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
802
+ raise error_class.new(response.body, code: code)
803
+ end
804
+ end
805
+
730
806
  # @param request_options [Hash]
731
807
  # @param params [Hash]
732
808
  # @option request_options [String] :base_url
@@ -878,6 +954,70 @@ module Schematic
878
954
  end
879
955
  end
880
956
 
957
+ # @param request_options [Hash]
958
+ # @param params [Hash]
959
+ # @option request_options [String] :base_url
960
+ # @option request_options [Hash{String => Object}] :additional_headers
961
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
962
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
963
+ # @option request_options [Integer] :timeout_in_seconds
964
+ # @option params [String] :entity_trait_definition_id
965
+ #
966
+ # @return [Schematic::Companies::Types::DeleteEntityTraitDefinitionResponse]
967
+ def delete_entity_trait_definition(request_options: {}, **params)
968
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
969
+ request = Schematic::Internal::JSON::Request.new(
970
+ base_url: request_options[:base_url],
971
+ method: "DELETE",
972
+ path: "entity-trait-definitions/#{URI.encode_uri_component(params[:entity_trait_definition_id].to_s)}",
973
+ request_options: request_options
974
+ )
975
+ begin
976
+ response = @client.send(request)
977
+ rescue Net::HTTPRequestTimeout
978
+ raise Schematic::Errors::TimeoutError
979
+ end
980
+ code = response.code.to_i
981
+ if code.between?(200, 299)
982
+ Schematic::Companies::Types::DeleteEntityTraitDefinitionResponse.load(response.body)
983
+ else
984
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
985
+ raise error_class.new(response.body, code: code)
986
+ end
987
+ end
988
+
989
+ # @param request_options [Hash]
990
+ # @param params [Hash]
991
+ # @option request_options [String] :base_url
992
+ # @option request_options [Hash{String => Object}] :additional_headers
993
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
994
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
995
+ # @option request_options [Integer] :timeout_in_seconds
996
+ # @option params [String] :entity_trait_definition_id
997
+ #
998
+ # @return [Schematic::Companies::Types::GetEntityTraitDefinitionUsageResponse]
999
+ def get_entity_trait_definition_usage(request_options: {}, **params)
1000
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1001
+ request = Schematic::Internal::JSON::Request.new(
1002
+ base_url: request_options[:base_url],
1003
+ method: "GET",
1004
+ path: "entity-trait-definitions/#{URI.encode_uri_component(params[:entity_trait_definition_id].to_s)}/usage",
1005
+ request_options: request_options
1006
+ )
1007
+ begin
1008
+ response = @client.send(request)
1009
+ rescue Net::HTTPRequestTimeout
1010
+ raise Schematic::Errors::TimeoutError
1011
+ end
1012
+ code = response.code.to_i
1013
+ if code.between?(200, 299)
1014
+ Schematic::Companies::Types::GetEntityTraitDefinitionUsageResponse.load(response.body)
1015
+ else
1016
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1017
+ raise error_class.new(response.body, code: code)
1018
+ end
1019
+ end
1020
+
881
1021
  # @param request_options [Hash]
882
1022
  # @param params [Hash]
883
1023
  # @option request_options [String] :base_url
@@ -972,6 +1112,50 @@ module Schematic
972
1112
  end
973
1113
  end
974
1114
 
1115
+ # @param request_options [Hash]
1116
+ # @param params [Hash]
1117
+ # @option request_options [String] :base_url
1118
+ # @option request_options [Hash{String => Object}] :additional_headers
1119
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1120
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1121
+ # @option request_options [Integer] :timeout_in_seconds
1122
+ # @option params [String, nil] :definition_id
1123
+ # @option params [Schematic::Types::EntityType, nil] :entity_type
1124
+ # @option params [Integer, nil] :limit
1125
+ # @option params [Integer, nil] :offset
1126
+ #
1127
+ # @return [Schematic::Companies::Types::CountEntityTraitsResponse]
1128
+ def count_entity_traits(request_options: {}, **params)
1129
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1130
+ query_param_names = %i[definition_id entity_type limit offset]
1131
+ query_params = {}
1132
+ query_params["definition_id"] = params[:definition_id] if params.key?(:definition_id)
1133
+ query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type)
1134
+ query_params["limit"] = params[:limit] if params.key?(:limit)
1135
+ query_params["offset"] = params[:offset] if params.key?(:offset)
1136
+ params.except(*query_param_names)
1137
+
1138
+ request = Schematic::Internal::JSON::Request.new(
1139
+ base_url: request_options[:base_url],
1140
+ method: "GET",
1141
+ path: "entity-traits/count",
1142
+ query: query_params,
1143
+ request_options: request_options
1144
+ )
1145
+ begin
1146
+ response = @client.send(request)
1147
+ rescue Net::HTTPRequestTimeout
1148
+ raise Schematic::Errors::TimeoutError
1149
+ end
1150
+ code = response.code.to_i
1151
+ if code.between?(200, 299)
1152
+ Schematic::Companies::Types::CountEntityTraitsResponse.load(response.body)
1153
+ else
1154
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1155
+ raise error_class.new(response.body, code: code)
1156
+ end
1157
+ end
1158
+
975
1159
  # @param request_options [Hash]
976
1160
  # @param params [Hash]
977
1161
  # @option request_options [String] :base_url
@@ -983,20 +1167,18 @@ module Schematic
983
1167
  # @option params [Schematic::Types::PlanChangeBasePlanAction, nil] :base_plan_action
984
1168
  # @option params [String, nil] :company_id
985
1169
  # @option params [String, nil] :company_ids
986
- # @option params [String, nil] :plan_ids
987
1170
  # @option params [Integer, nil] :limit
988
1171
  # @option params [Integer, nil] :offset
989
1172
  #
990
1173
  # @return [Schematic::Companies::Types::ListPlanChangesResponse]
991
1174
  def list_plan_changes(request_options: {}, **params)
992
1175
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
993
- query_param_names = %i[action base_plan_action company_id company_ids plan_ids limit offset]
1176
+ query_param_names = %i[action base_plan_action company_id company_ids limit offset]
994
1177
  query_params = {}
995
1178
  query_params["action"] = params[:action] if params.key?(:action)
996
1179
  query_params["base_plan_action"] = params[:base_plan_action] if params.key?(:base_plan_action)
997
1180
  query_params["company_id"] = params[:company_id] if params.key?(:company_id)
998
1181
  query_params["company_ids"] = params[:company_ids] if params.key?(:company_ids)
999
- query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids)
1000
1182
  query_params["limit"] = params[:limit] if params.key?(:limit)
1001
1183
  query_params["offset"] = params[:offset] if params.key?(:offset)
1002
1184
  params.except(*query_param_names)
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Companies
5
+ module Types
6
+ # Input parameters
7
+ class CountEntityKeysParams < Internal::Types::Model
8
+ field :definition_id, -> { String }, optional: true, nullable: false
9
+ field :entity_type, -> { Schematic::Types::EntityType }, optional: true, nullable: false
10
+ field :limit, -> { Integer }, optional: true, nullable: false
11
+ field :offset, -> { Integer }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Companies
5
+ module Types
6
+ class CountEntityKeysRequest < Internal::Types::Model
7
+ field :definition_id, -> { String }, optional: true, nullable: false
8
+ field :entity_type, -> { Schematic::Types::EntityType }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Companies
5
+ module Types
6
+ class CountEntityKeysResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CountResponse }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Companies::Types::CountEntityKeysParams }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Companies
5
+ module Types
6
+ # Input parameters
7
+ class CountEntityTraitsParams < Internal::Types::Model
8
+ field :definition_id, -> { String }, optional: true, nullable: false
9
+ field :entity_type, -> { Schematic::Types::EntityType }, optional: true, nullable: false
10
+ field :limit, -> { Integer }, optional: true, nullable: false
11
+ field :offset, -> { Integer }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Companies
5
+ module Types
6
+ class CountEntityTraitsRequest < Internal::Types::Model
7
+ field :definition_id, -> { String }, optional: true, nullable: false
8
+ field :entity_type, -> { Schematic::Types::EntityType }, optional: true, nullable: false
9
+ field :limit, -> { Integer }, optional: true, nullable: false
10
+ field :offset, -> { Integer }, optional: true, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Companies
5
+ module Types
6
+ class CountEntityTraitsResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::CountResponse }, optional: false, nullable: false
8
+ field :params, -> { Schematic::Companies::Types::CountEntityTraitsParams }, 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 Companies
5
+ module Types
6
+ class DeleteEntityKeyDefinitionResponse < 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 Companies
5
+ module Types
6
+ class DeleteEntityTraitDefinitionResponse < 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 Companies
5
+ module Types
6
+ class GetEntityTraitDefinitionUsageResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::EntityTraitDefinitionUsage }, optional: false, nullable: false
8
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -11,7 +11,6 @@ module Schematic
11
11
  field :company_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
12
12
  field :limit, -> { Integer }, optional: true, nullable: false
13
13
  field :offset, -> { Integer }, optional: true, nullable: false
14
- field :plan_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
15
14
  end
16
15
  end
17
16
  end
@@ -8,7 +8,6 @@ module Schematic
8
8
  field :base_plan_action, -> { Schematic::Types::PlanChangeBasePlanAction }, optional: true, nullable: false
9
9
  field :company_id, -> { String }, optional: true, nullable: false
10
10
  field :company_ids, -> { String }, optional: true, nullable: false
11
- field :plan_ids, -> { String }, optional: true, nullable: false
12
11
  field :limit, -> { Integer }, optional: true, nullable: false
13
12
  field :offset, -> { Integer }, optional: true, nullable: false
14
13
  end
@@ -6,6 +6,7 @@ module Schematic
6
6
  class CreateCreditBundleRequestBody < Internal::Types::Model
7
7
  field :bundle_name, -> { String }, optional: false, nullable: false
8
8
  field :bundle_type, -> { String }, optional: true, nullable: false
9
+ field :compatible_plan_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
9
10
  field :credit_id, -> { String }, optional: false, nullable: false
10
11
  field :currency, -> { String }, optional: false, nullable: false
11
12
  field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CreditBundleCurrencyPriceRequestBody] }, optional: true, nullable: false
@@ -6,6 +6,7 @@ module Schematic
6
6
  class UpdateCreditBundleDetailsRequestBody < Internal::Types::Model
7
7
  field :bundle_id, -> { String }, optional: false, nullable: false
8
8
  field :bundle_name, -> { String }, optional: false, nullable: false
9
+ field :compatible_plan_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
9
10
  field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CreditBundleCurrencyPriceRequestBody] }, optional: true, nullable: false
10
11
  field :expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: true, nullable: false
11
12
  field :expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: true, nullable: false
@@ -81,19 +81,19 @@ module Schematic
81
81
  # @option request_options [Hash{String => Object}] :additional_query_parameters
82
82
  # @option request_options [Hash{String => Object}] :additional_body_parameters
83
83
  # @option request_options [Integer] :timeout_in_seconds
84
- # @option params [String] :plan_bundle_id
84
+ # @option params [String] :plan_id
85
85
  #
86
86
  # @return [Schematic::Planbundle::Types::UpdatePlanBundleResponse]
87
87
  def update_plan_bundle(request_options: {}, **params)
88
88
  params = Schematic::Internal::Types::Utils.normalize_keys(params)
89
89
  request_data = Schematic::Planbundle::Types::UpdatePlanBundleRequestBody.new(params).to_h
90
- non_body_param_names = ["plan_bundle_id"]
90
+ non_body_param_names = ["plan_id"]
91
91
  body = request_data.except(*non_body_param_names)
92
92
 
93
93
  request = Schematic::Internal::JSON::Request.new(
94
94
  base_url: request_options[:base_url],
95
95
  method: "PUT",
96
- path: "plan-bundles/#{URI.encode_uri_component(params[:plan_bundle_id].to_s)}",
96
+ path: "plan-bundles/#{URI.encode_uri_component(params[:plan_id].to_s)}",
97
97
  body: body,
98
98
  request_options: request_options
99
99
  )
@@ -4,7 +4,7 @@ module Schematic
4
4
  module Planbundle
5
5
  module Types
6
6
  class UpdatePlanBundleRequestBody < Internal::Types::Model
7
- field :plan_bundle_id, -> { String }, optional: false, nullable: false
7
+ field :plan_id, -> { String }, optional: false, nullable: false
8
8
  field :billing_product, -> { Schematic::Types::UpsertBillingProductRequestBody }, optional: true, nullable: false
9
9
  field :credit_grants, -> { Internal::Types::Array[Schematic::Types::PlanBundleCreditGrantRequestBody] }, optional: true, nullable: false
10
10
  field :entitlements, -> { Internal::Types::Array[Schematic::Types::PlanBundleEntitlementRequestBody] }, optional: false, nullable: false
@@ -6,9 +6,11 @@ module Schematic
6
6
  class CreatePlanGroupRequestBody < Internal::Types::Model
7
7
  field :add_on_compatibilities, -> { Internal::Types::Array[Schematic::Types::CompatiblePlans] }, optional: true, nullable: false
8
8
  field :add_on_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
9
+ field :checkout_bundle_purchase_behavior, -> { Schematic::Types::CheckoutBundlePurchaseBehavior }, optional: false, nullable: false
9
10
  field :checkout_collect_address, -> { Internal::Types::Boolean }, optional: false, nullable: false
10
11
  field :checkout_collect_email, -> { Internal::Types::Boolean }, optional: false, nullable: false
11
12
  field :checkout_collect_phone, -> { Internal::Types::Boolean }, optional: false, nullable: false
13
+ field :checkout_collect_tax_id, -> { Internal::Types::Boolean }, optional: false, nullable: false
12
14
  field :custom_checkout_fields, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldInput] }, optional: true, nullable: false
13
15
  field :custom_plan_config, -> { Schematic::Types::CustomPlanConfig }, optional: true, nullable: false
14
16
  field :custom_plan_id, -> { String }, optional: true, nullable: false