schematichq 1.4.1 → 1.4.3
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.
- checksums.yaml +4 -4
- data/.fern/metadata.json +3 -3
- data/.fern/replay.lock +10 -0
- data/.fernignore +3 -0
- data/README.md +34 -4
- data/WASM_VERSION +1 -1
- data/lib/schematic/billing/client.rb +38 -2
- data/lib/schematic/billing/types/count_billing_products_params.rb +1 -0
- data/lib/schematic/billing/types/count_billing_products_request.rb +1 -0
- data/lib/schematic/billing/types/create_billing_price_request_body.rb +1 -0
- data/lib/schematic/billing/types/delete_payment_method_by_external_id_response.rb +12 -0
- data/lib/schematic/billing/types/list_billing_products_params.rb +1 -0
- data/lib/schematic/billing/types/list_billing_products_request.rb +1 -0
- data/lib/schematic/client.rb +6 -6
- data/lib/schematic/companies/client.rb +6 -2
- data/lib/schematic/companies/types/count_companies_params.rb +1 -0
- data/lib/schematic/companies/types/count_companies_request.rb +1 -0
- data/lib/schematic/companies/types/list_companies_params.rb +1 -0
- data/lib/schematic/companies/types/list_companies_request.rb +1 -0
- data/lib/schematic/credits/client.rb +108 -2
- data/lib/schematic/credits/types/acquire_credit_lease_request_body.rb +14 -0
- data/lib/schematic/credits/types/acquire_credit_lease_response.rb +12 -0
- data/lib/schematic/credits/types/count_billing_plan_credit_grants_params.rb +1 -0
- data/lib/schematic/credits/types/count_billing_plan_credit_grants_request.rb +1 -0
- data/lib/schematic/credits/types/extend_credit_lease_request_body.rb +13 -0
- data/lib/schematic/credits/types/extend_credit_lease_response.rb +12 -0
- data/lib/schematic/credits/types/list_billing_plan_credit_grants_params.rb +1 -0
- data/lib/schematic/credits/types/list_billing_plan_credit_grants_request.rb +1 -0
- data/lib/schematic/credits/types/release_credit_lease_response.rb +12 -0
- data/lib/schematic/datastream/merge.rb +71 -0
- data/lib/schematic/datastream/websocket_client.rb +32 -1
- data/lib/schematic/entitlements/client.rb +6 -2
- data/lib/schematic/entitlements/types/count_feature_usage_params.rb +1 -0
- data/lib/schematic/entitlements/types/count_feature_usage_request.rb +1 -0
- data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +5 -0
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +5 -0
- data/lib/schematic/entitlements/types/list_feature_usage_params.rb +1 -0
- data/lib/schematic/entitlements/types/list_feature_usage_request.rb +1 -0
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +5 -0
- data/lib/schematic/event_buffer.rb +17 -3
- data/lib/schematic/events/client.rb +3 -1
- data/lib/schematic/events/types/list_events_params.rb +1 -0
- data/lib/schematic/events/types/list_events_request.rb +1 -0
- data/lib/schematic/features/client.rb +6 -2
- data/lib/schematic/features/types/count_features_params.rb +1 -0
- data/lib/schematic/features/types/count_features_request.rb +1 -0
- data/lib/schematic/features/types/list_features_params.rb +1 -0
- data/lib/schematic/features/types/list_features_request.rb +1 -0
- data/lib/schematic/integrationsapi/client.rb +177 -0
- data/lib/schematic/integrationsapi/types/list_integrations_params.rb +18 -0
- data/lib/schematic/integrationsapi/types/list_integrations_request.rb +17 -0
- data/lib/schematic/integrationsapi/types/list_integrations_response.rb +12 -0
- data/lib/schematic/integrationsapi/types/load_sample_data_set_v_2_response.rb +12 -0
- data/lib/schematic/integrationsapi/types/run_integration_response.rb +12 -0
- data/lib/schematic/integrationsapi/types/start_data_import_request_body.rb +13 -0
- data/lib/schematic/integrationsapi/types/start_data_import_response.rb +12 -0
- data/lib/schematic/integrationsapi/types/uninstall_integration_response.rb +12 -0
- data/lib/schematic/logger.rb +1 -1
- data/lib/schematic/planbundle/client.rb +32 -0
- data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +13 -0
- data/lib/schematic/planbundle/types/create_custom_plan_bundle_response.rb +12 -0
- data/lib/schematic/planmigrations/client.rb +101 -0
- data/lib/schematic/planmigrations/types/create_migration_input.rb +17 -0
- data/lib/schematic/planmigrations/types/create_migration_response.rb +12 -0
- data/lib/schematic/planmigrations/types/retry_company_migration_response.rb +12 -0
- data/lib/schematic/planmigrations/types/retry_migration_request_body.rb +12 -0
- data/lib/schematic/planmigrations/types/retry_migration_response.rb +12 -0
- data/lib/schematic/plans/client.rb +43 -2
- data/lib/schematic/plans/types/count_plans_params.rb +2 -0
- data/lib/schematic/plans/types/count_plans_request.rb +2 -0
- data/lib/schematic/plans/types/create_billing_linked_plan_request_body.rb +1 -0
- data/lib/schematic/plans/types/list_plans_params.rb +2 -0
- data/lib/schematic/plans/types/list_plans_request.rb +2 -0
- data/lib/schematic/plans/types/mark_custom_plan_billing_paid_response.rb +12 -0
- data/lib/schematic/schematic_client.rb +46 -13
- data/lib/schematic/types/api_key_create_response_data.rb +1 -0
- data/lib/schematic/types/api_key_integration_response_data.rb +11 -0
- data/lib/schematic/types/api_key_response_data.rb +1 -0
- data/lib/schematic/types/audit_log_list_response_data.rb +1 -0
- data/lib/schematic/types/audit_log_response_data.rb +1 -0
- data/lib/schematic/types/billing_credit_bundle_view.rb +1 -1
- data/lib/schematic/types/billing_credit_view.rb +1 -0
- data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +1 -0
- data/lib/schematic/types/billing_price_response_data.rb +1 -0
- data/lib/schematic/types/billing_price_view.rb +1 -0
- data/lib/schematic/types/billing_product_for_subscription_response_data.rb +1 -0
- data/lib/schematic/types/billing_product_plan_response_data.rb +1 -0
- data/lib/schematic/types/billing_product_price_response_data.rb +1 -0
- data/lib/schematic/types/billing_strategy.rb +13 -0
- data/lib/schematic/types/change_subscription_internal_request_body.rb +1 -0
- data/lib/schematic/types/change_subscription_request_body.rb +1 -0
- data/lib/schematic/types/charge_type.rb +1 -0
- data/lib/schematic/types/checkout_subscription.rb +1 -0
- data/lib/schematic/types/clerk_integration_config.rb +10 -0
- data/lib/schematic/types/company_matching_criteria.rb +12 -0
- data/lib/schematic/types/company_plan_credit_grant_view.rb +40 -0
- data/lib/schematic/types/company_plan_detail_response_data.rb +4 -1
- data/lib/schematic/types/company_plan_with_billing_sub_view.rb +1 -1
- data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +1 -0
- data/lib/schematic/types/create_custom_plan_bundle_plan_request_body.rb +12 -0
- data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +5 -0
- data/lib/schematic/types/create_event_request_body.rb +3 -0
- data/lib/schematic/types/credit_currency_price.rb +10 -0
- data/lib/schematic/types/credit_lease_response_data.rb +16 -0
- data/lib/schematic/types/currency_price_request_body.rb +3 -0
- data/lib/schematic/types/custom_plan_billing_response_data.rb +1 -0
- data/lib/schematic/types/data_event_payload.rb +3 -0
- data/lib/schematic/types/duplicate_plan_entitlements_response_response_data.rb +1 -0
- data/lib/schematic/types/entitlement_currency_prices_response_data.rb +1 -0
- data/lib/schematic/types/event_body_track.rb +1 -0
- data/lib/schematic/types/event_detail_response_data.rb +2 -0
- data/lib/schematic/types/event_response_data.rb +1 -0
- data/lib/schematic/types/feature_company_response_data.rb +1 -0
- data/lib/schematic/types/feature_usage_response_data.rb +1 -0
- data/lib/schematic/types/feature_view.rb +1 -0
- data/lib/schematic/types/integration_capabilities.rb +11 -0
- data/lib/schematic/types/integration_config.rb +16 -0
- data/lib/schematic/types/integration_response_data.rb +13 -0
- data/lib/schematic/types/integration_state.rb +13 -0
- data/lib/schematic/types/integration_type.rb +1 -0
- data/lib/schematic/types/integrations_data_set_response_data.rb +9 -0
- data/lib/schematic/types/integrations_list_response_data.rb +15 -0
- data/lib/schematic/types/integrations_response_data.rb +13 -0
- data/lib/schematic/types/mark_custom_plan_billing_paid_request_body.rb +23 -0
- data/lib/schematic/types/migration_error_code.rb +21 -0
- data/lib/schematic/types/orb_integration_config.rb +9 -0
- data/lib/schematic/types/plan_credit_grant_view.rb +1 -0
- data/lib/schematic/types/plan_currency_price_request_body.rb +1 -0
- data/lib/schematic/types/plan_currency_prices_response_data.rb +1 -0
- data/lib/schematic/types/plan_detail_response_data.rb +3 -0
- data/lib/schematic/types/plan_entitlement_response_data.rb +2 -0
- data/lib/schematic/types/plan_group_plan_detail_response_data.rb +4 -1
- data/lib/schematic/types/plan_price_cadence.rb +13 -0
- data/lib/schematic/types/plan_version_company_migration_response_data.rb +1 -0
- data/lib/schematic/types/plan_version_migration_response_data.rb +1 -0
- data/lib/schematic/types/plan_view_public_response_data.rb +4 -1
- data/lib/schematic/types/release_credit_lease_request_body.rb +23 -0
- data/lib/schematic/types/rules_engine_schema_version.rb +1 -1
- data/lib/schematic/types/stripe_integration_config.rb +14 -0
- data/lib/schematic/types/update_auto_topup_override_request_body.rb +12 -0
- data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +1 -0
- data/lib/schematic/types/upsert_billing_product_request_body.rb +3 -0
- data/lib/schematic/types/usage_based_entitlement_request_body.rb +5 -0
- data/lib/schematic/types/usage_based_entitlement_response_data.rb +2 -0
- data/lib/schematic/types/work_os_integration_config.rb +10 -0
- data/lib/schematic/version.rb +1 -1
- data/lib/schematic/wasm/rulesengine.wasm +0 -0
- data/lib/schematic.rb +55 -10
- data/reference.md +1355 -188
- metadata +48 -2
|
@@ -95,6 +95,39 @@ module Schematic
|
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
+
# @param request_options [Hash]
|
|
99
|
+
# @param params [Schematic::Types::MarkCustomPlanBillingPaidRequestBody]
|
|
100
|
+
# @option request_options [String] :base_url
|
|
101
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
102
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
103
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
104
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
105
|
+
# @option params [String] :custom_plan_billing_id
|
|
106
|
+
#
|
|
107
|
+
# @return [Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse]
|
|
108
|
+
def mark_custom_plan_billing_paid(request_options: {}, **params)
|
|
109
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
110
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
111
|
+
base_url: request_options[:base_url],
|
|
112
|
+
method: "PUT",
|
|
113
|
+
path: "custom-plan-billings/#{URI.encode_uri_component(params[:custom_plan_billing_id].to_s)}/mark-paid",
|
|
114
|
+
body: params,
|
|
115
|
+
request_options: request_options
|
|
116
|
+
)
|
|
117
|
+
begin
|
|
118
|
+
response = @client.send(request)
|
|
119
|
+
rescue Net::HTTPRequestTimeout
|
|
120
|
+
raise Schematic::Errors::TimeoutError
|
|
121
|
+
end
|
|
122
|
+
code = response.code.to_i
|
|
123
|
+
if code.between?(200, 299)
|
|
124
|
+
Schematic::Plans::Types::MarkCustomPlanBillingPaidResponse.load(response.body)
|
|
125
|
+
else
|
|
126
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
127
|
+
raise error_class.new(response.body, code: code)
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
98
131
|
# @param request_options [Hash]
|
|
99
132
|
# @param params [Schematic::Plans::Types::RetryCustomPlanBillingRequestBody]
|
|
100
133
|
# @option request_options [String] :base_url
|
|
@@ -172,6 +205,7 @@ module Schematic
|
|
|
172
205
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
173
206
|
# @option request_options [Integer] :timeout_in_seconds
|
|
174
207
|
# @option params [String, nil] :company_id
|
|
208
|
+
# @option params [Boolean, nil] :company_scoped_only
|
|
175
209
|
# @option params [Boolean, nil] :exclude_company_scoped
|
|
176
210
|
# @option params [Boolean, nil] :for_fallback_plan
|
|
177
211
|
# @option params [Boolean, nil] :for_initial_plan
|
|
@@ -182,6 +216,7 @@ module Schematic
|
|
|
182
216
|
# @option params [Schematic::Types::PlanType, nil] :plan_type
|
|
183
217
|
# @option params [String, nil] :q
|
|
184
218
|
# @option params [String, nil] :scoped_to_company_id
|
|
219
|
+
# @option params [Boolean, nil] :with_entitlements
|
|
185
220
|
# @option params [String, nil] :without_entitlement_for
|
|
186
221
|
# @option params [Boolean, nil] :without_paid_product_id
|
|
187
222
|
# @option params [Integer, nil] :limit
|
|
@@ -190,9 +225,10 @@ module Schematic
|
|
|
190
225
|
# @return [Schematic::Plans::Types::ListPlansResponse]
|
|
191
226
|
def list_plans(request_options: {}, **params)
|
|
192
227
|
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
193
|
-
query_param_names = %i[company_id exclude_company_scoped for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q scoped_to_company_id without_entitlement_for without_paid_product_id limit offset]
|
|
228
|
+
query_param_names = %i[company_id company_scoped_only exclude_company_scoped for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q scoped_to_company_id with_entitlements without_entitlement_for without_paid_product_id limit offset]
|
|
194
229
|
query_params = {}
|
|
195
230
|
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
231
|
+
query_params["company_scoped_only"] = params[:company_scoped_only] if params.key?(:company_scoped_only)
|
|
196
232
|
query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
|
|
197
233
|
query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
|
|
198
234
|
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
|
|
@@ -203,6 +239,7 @@ module Schematic
|
|
|
203
239
|
query_params["plan_type"] = params[:plan_type] if params.key?(:plan_type)
|
|
204
240
|
query_params["q"] = params[:q] if params.key?(:q)
|
|
205
241
|
query_params["scoped_to_company_id"] = params[:scoped_to_company_id] if params.key?(:scoped_to_company_id)
|
|
242
|
+
query_params["with_entitlements"] = params[:with_entitlements] if params.key?(:with_entitlements)
|
|
206
243
|
query_params["without_entitlement_for"] = params[:without_entitlement_for] if params.key?(:without_entitlement_for)
|
|
207
244
|
query_params["without_paid_product_id"] = params[:without_paid_product_id] if params.key?(:without_paid_product_id)
|
|
208
245
|
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
@@ -527,6 +564,7 @@ module Schematic
|
|
|
527
564
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
528
565
|
# @option request_options [Integer] :timeout_in_seconds
|
|
529
566
|
# @option params [String, nil] :company_id
|
|
567
|
+
# @option params [Boolean, nil] :company_scoped_only
|
|
530
568
|
# @option params [Boolean, nil] :exclude_company_scoped
|
|
531
569
|
# @option params [Boolean, nil] :for_fallback_plan
|
|
532
570
|
# @option params [Boolean, nil] :for_initial_plan
|
|
@@ -537,6 +575,7 @@ module Schematic
|
|
|
537
575
|
# @option params [Schematic::Types::PlanType, nil] :plan_type
|
|
538
576
|
# @option params [String, nil] :q
|
|
539
577
|
# @option params [String, nil] :scoped_to_company_id
|
|
578
|
+
# @option params [Boolean, nil] :with_entitlements
|
|
540
579
|
# @option params [String, nil] :without_entitlement_for
|
|
541
580
|
# @option params [Boolean, nil] :without_paid_product_id
|
|
542
581
|
# @option params [Integer, nil] :limit
|
|
@@ -545,9 +584,10 @@ module Schematic
|
|
|
545
584
|
# @return [Schematic::Plans::Types::CountPlansResponse]
|
|
546
585
|
def count_plans(request_options: {}, **params)
|
|
547
586
|
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
548
|
-
query_param_names = %i[company_id exclude_company_scoped for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q scoped_to_company_id without_entitlement_for without_paid_product_id limit offset]
|
|
587
|
+
query_param_names = %i[company_id company_scoped_only exclude_company_scoped for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q scoped_to_company_id with_entitlements without_entitlement_for without_paid_product_id limit offset]
|
|
549
588
|
query_params = {}
|
|
550
589
|
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
590
|
+
query_params["company_scoped_only"] = params[:company_scoped_only] if params.key?(:company_scoped_only)
|
|
551
591
|
query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
|
|
552
592
|
query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
|
|
553
593
|
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
|
|
@@ -558,6 +598,7 @@ module Schematic
|
|
|
558
598
|
query_params["plan_type"] = params[:plan_type] if params.key?(:plan_type)
|
|
559
599
|
query_params["q"] = params[:q] if params.key?(:q)
|
|
560
600
|
query_params["scoped_to_company_id"] = params[:scoped_to_company_id] if params.key?(:scoped_to_company_id)
|
|
601
|
+
query_params["with_entitlements"] = params[:with_entitlements] if params.key?(:with_entitlements)
|
|
561
602
|
query_params["without_entitlement_for"] = params[:without_entitlement_for] if params.key?(:without_entitlement_for)
|
|
562
603
|
query_params["without_paid_product_id"] = params[:without_paid_product_id] if params.key?(:without_paid_product_id)
|
|
563
604
|
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
@@ -6,6 +6,7 @@ module Schematic
|
|
|
6
6
|
# Input parameters
|
|
7
7
|
class CountPlansParams < Internal::Types::Model
|
|
8
8
|
field :company_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
9
10
|
field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
10
11
|
field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
11
12
|
field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -18,6 +19,7 @@ module Schematic
|
|
|
18
19
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
19
20
|
field :q, -> { String }, optional: true, nullable: false
|
|
20
21
|
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
22
|
+
field :with_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
21
23
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
22
24
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
23
25
|
end
|
|
@@ -5,6 +5,7 @@ module Schematic
|
|
|
5
5
|
module Types
|
|
6
6
|
class CountPlansRequest < Internal::Types::Model
|
|
7
7
|
field :company_id, -> { String }, optional: true, nullable: false
|
|
8
|
+
field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
8
9
|
field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
9
10
|
field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
10
11
|
field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -15,6 +16,7 @@ module Schematic
|
|
|
15
16
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
16
17
|
field :q, -> { String }, optional: true, nullable: false
|
|
17
18
|
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
19
|
+
field :with_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
18
20
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
19
21
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
20
22
|
field :limit, -> { Integer }, optional: true, nullable: false
|
|
@@ -7,6 +7,7 @@ module Schematic
|
|
|
7
7
|
field :billing_provider, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
|
|
8
8
|
field :description, -> { String }, optional: false, nullable: false
|
|
9
9
|
field :external_resource_id, -> { String }, optional: false, nullable: false
|
|
10
|
+
field :external_resource_version, -> { String }, optional: true, nullable: false
|
|
10
11
|
field :icon, -> { Schematic::Types::PlanIcon }, optional: true, nullable: false
|
|
11
12
|
field :name, -> { String }, optional: false, nullable: false
|
|
12
13
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: false, nullable: false
|
|
@@ -6,6 +6,7 @@ module Schematic
|
|
|
6
6
|
# Input parameters
|
|
7
7
|
class ListPlansParams < Internal::Types::Model
|
|
8
8
|
field :company_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
9
10
|
field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
10
11
|
field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
11
12
|
field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -18,6 +19,7 @@ module Schematic
|
|
|
18
19
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
19
20
|
field :q, -> { String }, optional: true, nullable: false
|
|
20
21
|
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
22
|
+
field :with_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
21
23
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
22
24
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
23
25
|
end
|
|
@@ -5,6 +5,7 @@ module Schematic
|
|
|
5
5
|
module Types
|
|
6
6
|
class ListPlansRequest < Internal::Types::Model
|
|
7
7
|
field :company_id, -> { String }, optional: true, nullable: false
|
|
8
|
+
field :company_scoped_only, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
8
9
|
field :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
9
10
|
field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
10
11
|
field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -15,6 +16,7 @@ module Schematic
|
|
|
15
16
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
16
17
|
field :q, -> { String }, optional: true, nullable: false
|
|
17
18
|
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
19
|
+
field :with_entitlements, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
18
20
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
19
21
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
20
22
|
field :limit, -> { Integer }, optional: true, nullable: false
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class MarkCustomPlanBillingPaidResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::CustomPlanBillingResponseData }, optional: false, nullable: false
|
|
8
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -56,6 +56,12 @@ module Schematic
|
|
|
56
56
|
DEFAULT_CACHE_MAX_SIZE = 1000
|
|
57
57
|
DEFAULT_EVENT_BUFFER_PERIOD = 5.0 # seconds (canonical Go value)
|
|
58
58
|
|
|
59
|
+
# Optional event metadata accepted via the `options:` keyword on track/identify.
|
|
60
|
+
# identify only honors :idempotency_key; track also honors :sent_at,
|
|
61
|
+
# :trusted_client_clock, and :backfill. Fields are only sent when set.
|
|
62
|
+
TRACK_OPTION_KEYS = %i[idempotency_key sent_at trusted_client_clock backfill].freeze
|
|
63
|
+
IDENTIFY_OPTION_KEYS = %i[idempotency_key].freeze
|
|
64
|
+
|
|
59
65
|
def initialize(
|
|
60
66
|
api_key: nil,
|
|
61
67
|
base_url: nil,
|
|
@@ -67,7 +73,7 @@ module Schematic
|
|
|
67
73
|
use_data_stream: false,
|
|
68
74
|
datastream_options: {},
|
|
69
75
|
logger: nil,
|
|
70
|
-
log_level: :
|
|
76
|
+
log_level: :warn
|
|
71
77
|
)
|
|
72
78
|
@api_key = api_key
|
|
73
79
|
@base_url = base_url || DEFAULT_BASE_URL
|
|
@@ -251,26 +257,18 @@ module Schematic
|
|
|
251
257
|
|
|
252
258
|
# --- Event Submission ---
|
|
253
259
|
|
|
254
|
-
def identify(body)
|
|
260
|
+
def identify(body, options: nil)
|
|
255
261
|
return if @offline
|
|
256
262
|
|
|
257
|
-
@event_buffer.push(
|
|
258
|
-
event_type: "identify",
|
|
259
|
-
body: body,
|
|
260
|
-
sent_at: Time.now.utc.iso8601
|
|
261
|
-
})
|
|
263
|
+
@event_buffer.push(build_event("identify", body, options, IDENTIFY_OPTION_KEYS))
|
|
262
264
|
rescue StandardError => e
|
|
263
265
|
@logger.error("Error sending identify event: #{e.message}")
|
|
264
266
|
end
|
|
265
267
|
|
|
266
|
-
def track(body)
|
|
268
|
+
def track(body, options: nil)
|
|
267
269
|
return if @offline
|
|
268
270
|
|
|
269
|
-
@event_buffer.push(
|
|
270
|
-
event_type: "track",
|
|
271
|
-
body: body,
|
|
272
|
-
sent_at: Time.now.utc.iso8601
|
|
273
|
-
})
|
|
271
|
+
@event_buffer.push(build_event("track", body, options, TRACK_OPTION_KEYS))
|
|
274
272
|
|
|
275
273
|
# Update company metrics locally if DataStream is active and connected
|
|
276
274
|
if @datastream_client&.connected? && body[:company]
|
|
@@ -495,6 +493,41 @@ module Schematic
|
|
|
495
493
|
results
|
|
496
494
|
end
|
|
497
495
|
|
|
496
|
+
# Build the buffered event hash, applying any caller-supplied options.
|
|
497
|
+
# Only keys in allowed_keys are honored, and only when explicitly set, so
|
|
498
|
+
# unset fields never appear on the wire.
|
|
499
|
+
def build_event(event_type, body, options, allowed_keys)
|
|
500
|
+
event = {
|
|
501
|
+
event_type: event_type,
|
|
502
|
+
body: body,
|
|
503
|
+
sent_at: Time.now.utc.iso8601
|
|
504
|
+
}
|
|
505
|
+
return event unless options.is_a?(Hash)
|
|
506
|
+
|
|
507
|
+
allowed_keys.each do |key|
|
|
508
|
+
value = option_value(options, key)
|
|
509
|
+
next if value.nil?
|
|
510
|
+
|
|
511
|
+
event[key] = key == :sent_at ? normalize_sent_at(value) : value
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
event
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
def option_value(options, key)
|
|
518
|
+
return options[key] if options.key?(key)
|
|
519
|
+
|
|
520
|
+
options[key.to_s]
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
def normalize_sent_at(value)
|
|
524
|
+
return value if value.is_a?(String)
|
|
525
|
+
return value.utc.iso8601 if value.respond_to?(:utc)
|
|
526
|
+
return value.iso8601 if value.respond_to?(:iso8601)
|
|
527
|
+
|
|
528
|
+
value
|
|
529
|
+
end
|
|
530
|
+
|
|
498
531
|
def enqueue_flag_check_event(flag_key, response, company, user)
|
|
499
532
|
body = {
|
|
500
533
|
flag_key: flag_key,
|
|
@@ -8,6 +8,7 @@ module Schematic
|
|
|
8
8
|
field :environment, -> { Schematic::Types::EnvironmentResponseData }, optional: true, nullable: false
|
|
9
9
|
field :environment_id, -> { String }, optional: true, nullable: false
|
|
10
10
|
field :id, -> { String }, optional: false, nullable: false
|
|
11
|
+
field :integration, -> { Schematic::Types::ApiKeyIntegrationResponseData }, optional: true, nullable: false
|
|
11
12
|
field :last_used_at, -> { String }, optional: true, nullable: false
|
|
12
13
|
field :name, -> { String }, optional: false, nullable: false
|
|
13
14
|
field :readonly, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Types
|
|
5
|
+
class ApiKeyIntegrationResponseData < Internal::Types::Model
|
|
6
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
7
|
+
field :state, -> { Schematic::Types::IntegrationState }, optional: false, nullable: false
|
|
8
|
+
field :type, -> { Schematic::Types::IntegrationType }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -8,6 +8,7 @@ module Schematic
|
|
|
8
8
|
field :environment, -> { Schematic::Types::EnvironmentResponseData }, optional: true, nullable: false
|
|
9
9
|
field :environment_id, -> { String }, optional: true, nullable: false
|
|
10
10
|
field :id, -> { String }, optional: false, nullable: false
|
|
11
|
+
field :integration, -> { Schematic::Types::ApiKeyIntegrationResponseData }, optional: true, nullable: false
|
|
11
12
|
field :last_used_at, -> { String }, optional: true, nullable: false
|
|
12
13
|
field :name, -> { String }, optional: false, nullable: false
|
|
13
14
|
field :readonly, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
@@ -4,6 +4,7 @@ module Schematic
|
|
|
4
4
|
module Types
|
|
5
5
|
class AuditLogListResponseData < Internal::Types::Model
|
|
6
6
|
field :actor_type, -> { Schematic::Types::ActorType }, optional: false, nullable: false
|
|
7
|
+
field :api_key, -> { Schematic::Types::ApiKeyResponseData }, optional: true, nullable: false
|
|
7
8
|
field :api_key_id, -> { String }, optional: true, nullable: false
|
|
8
9
|
field :ended_at, -> { String }, optional: true, nullable: false
|
|
9
10
|
field :environment, -> { Schematic::Types::EnvironmentResponseData }, optional: true, nullable: false
|
|
@@ -4,6 +4,7 @@ module Schematic
|
|
|
4
4
|
module Types
|
|
5
5
|
class AuditLogResponseData < Internal::Types::Model
|
|
6
6
|
field :actor_type, -> { Schematic::Types::ActorType }, optional: false, nullable: false
|
|
7
|
+
field :api_key, -> { Schematic::Types::ApiKeyResponseData }, optional: true, nullable: false
|
|
7
8
|
field :api_key_id, -> { String }, optional: true, nullable: false
|
|
8
9
|
field :ended_at, -> { String }, optional: true, nullable: false
|
|
9
10
|
field :environment, -> { Schematic::Types::EnvironmentResponseData }, optional: true, nullable: false
|
|
@@ -9,7 +9,7 @@ module Schematic
|
|
|
9
9
|
field :credit_icon, -> { String }, optional: true, nullable: false
|
|
10
10
|
field :credit_id, -> { String }, optional: false, nullable: false
|
|
11
11
|
field :credit_name, -> { String }, optional: false, nullable: false
|
|
12
|
-
field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CreditBundleCurrencyPrice] }, optional:
|
|
12
|
+
field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CreditBundleCurrencyPrice] }, optional: false, nullable: false
|
|
13
13
|
field :expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: false, nullable: false
|
|
14
14
|
field :expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: false, nullable: false
|
|
15
15
|
field :expiry_unit_count, -> { Integer }, optional: true, nullable: false
|
|
@@ -7,6 +7,7 @@ module Schematic
|
|
|
7
7
|
field :burn_strategy, -> { Schematic::Types::BillingCreditBurnStrategy }, optional: false, nullable: false
|
|
8
8
|
field :cost_editable, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
9
9
|
field :created_at, -> { String }, optional: false, nullable: false
|
|
10
|
+
field :currency_prices, -> { Internal::Types::Array[Schematic::Types::CreditCurrencyPrice] }, optional: false, nullable: false
|
|
10
11
|
field :default_expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: false, nullable: false
|
|
11
12
|
field :default_expiry_unit_count, -> { Integer }, optional: true, nullable: false
|
|
12
13
|
field :default_rollover_policy, -> { Schematic::Types::BillingCreditRolloverPolicy }, optional: false, nullable: false
|
|
@@ -9,6 +9,7 @@ module Schematic
|
|
|
9
9
|
field :auto_topup_expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: true, nullable: false
|
|
10
10
|
field :auto_topup_expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: true, nullable: false
|
|
11
11
|
field :auto_topup_expiry_unit_count, -> { Integer }, optional: true, nullable: false
|
|
12
|
+
field :auto_topup_self_service, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
12
13
|
field :auto_topup_threshold_credits, -> { Integer }, optional: true, nullable: false
|
|
13
14
|
field :auto_topup_threshold_percent, -> { Integer }, optional: true, nullable: false
|
|
14
15
|
field :created_at, -> { String }, optional: false, nullable: false
|
|
@@ -7,6 +7,7 @@ module Schematic
|
|
|
7
7
|
field :external_price_id, -> { String }, optional: false, nullable: false
|
|
8
8
|
field :id, -> { String }, optional: false, nullable: false
|
|
9
9
|
field :interval, -> { Schematic::Types::BillingProductPriceInterval }, optional: false, nullable: false
|
|
10
|
+
field :interval_count, -> { Integer }, optional: false, nullable: false
|
|
10
11
|
field :nickname, -> { String }, optional: true, nullable: false
|
|
11
12
|
field :price, -> { Integer }, optional: false, nullable: false
|
|
12
13
|
field :price_decimal, -> { String }, optional: true, nullable: false
|
|
@@ -8,6 +8,7 @@ module Schematic
|
|
|
8
8
|
field :currency, -> { String }, optional: false, nullable: false
|
|
9
9
|
field :id, -> { String }, optional: false, nullable: false
|
|
10
10
|
field :interval, -> { Schematic::Types::BillingProductPriceInterval }, optional: false, nullable: false
|
|
11
|
+
field :interval_count, -> { Integer }, optional: false, nullable: false
|
|
11
12
|
field :is_active, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
12
13
|
field :meter_event_name, -> { String }, optional: true, nullable: false
|
|
13
14
|
field :meter_event_payload_key, -> { String }, optional: true, nullable: false
|
|
@@ -11,6 +11,7 @@ module Schematic
|
|
|
11
11
|
field :external_id, -> { String }, optional: false, nullable: false
|
|
12
12
|
field :id, -> { String }, optional: false, nullable: false
|
|
13
13
|
field :interval, -> { String }, optional: false, nullable: false
|
|
14
|
+
field :interval_count, -> { Integer }, optional: true, nullable: false
|
|
14
15
|
field :meter_id, -> { String }, optional: true, nullable: false
|
|
15
16
|
field :name, -> { String }, optional: false, nullable: false
|
|
16
17
|
field :package_size, -> { Integer }, optional: false, nullable: false
|
|
@@ -5,6 +5,7 @@ module Schematic
|
|
|
5
5
|
class BillingProductPlanResponseData < Internal::Types::Model
|
|
6
6
|
field :account_id, -> { String }, optional: false, nullable: false
|
|
7
7
|
field :billing_product_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
field :billing_strategy, -> { Schematic::Types::BillingStrategy }, optional: false, nullable: false
|
|
8
9
|
field :charge_type, -> { Schematic::Types::ChargeType }, optional: false, nullable: false
|
|
9
10
|
field :controlled_by, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
|
|
10
11
|
field :environment_id, -> { String }, optional: false, nullable: false
|
|
@@ -8,6 +8,7 @@ module Schematic
|
|
|
8
8
|
field :currency, -> { String }, optional: false, nullable: false
|
|
9
9
|
field :id, -> { String }, optional: false, nullable: false
|
|
10
10
|
field :interval, -> { Schematic::Types::BillingProductPriceInterval }, optional: false, nullable: false
|
|
11
|
+
field :interval_count, -> { Integer }, optional: false, 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
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Types
|
|
5
|
+
module BillingStrategy
|
|
6
|
+
extend Schematic::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
SCHEMATIC_MANAGED = "schematic_managed"
|
|
9
|
+
PROVIDER_MANAGED = "provider_managed"
|
|
10
|
+
NO_BILLING = "no_billing"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -4,6 +4,7 @@ module Schematic
|
|
|
4
4
|
module Types
|
|
5
5
|
class ChangeSubscriptionInternalRequestBody < Internal::Types::Model
|
|
6
6
|
field :add_on_ids, -> { Internal::Types::Array[Schematic::Types::UpdateAddOnRequestBody] }, optional: false, nullable: false
|
|
7
|
+
field :auto_topup_overrides, -> { Internal::Types::Array[Schematic::Types::UpdateAutoTopupOverrideRequestBody] }, optional: false, nullable: false
|
|
7
8
|
field :company_id, -> { String }, optional: false, nullable: false
|
|
8
9
|
field :coupon_external_id, -> { String }, optional: true, nullable: false
|
|
9
10
|
field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::UpdateCreditBundleRequestBody] }, optional: false, nullable: false
|
|
@@ -4,6 +4,7 @@ module Schematic
|
|
|
4
4
|
module Types
|
|
5
5
|
class ChangeSubscriptionRequestBody < Internal::Types::Model
|
|
6
6
|
field :add_on_ids, -> { Internal::Types::Array[Schematic::Types::UpdateAddOnRequestBody] }, optional: false, nullable: false
|
|
7
|
+
field :auto_topup_overrides, -> { Internal::Types::Array[Schematic::Types::UpdateAutoTopupOverrideRequestBody] }, optional: false, nullable: false
|
|
7
8
|
field :coupon_external_id, -> { String }, optional: true, nullable: false
|
|
8
9
|
field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::UpdateCreditBundleRequestBody] }, optional: false, nullable: false
|
|
9
10
|
field :new_plan_id, -> { String }, optional: false, nullable: false
|
|
@@ -16,6 +16,7 @@ module Schematic
|
|
|
16
16
|
field :expired_at, -> { String }, optional: true, nullable: false
|
|
17
17
|
field :id, -> { String }, optional: false, nullable: false
|
|
18
18
|
field :interval, -> { String }, optional: false, nullable: false
|
|
19
|
+
field :invoice_id, -> { String }, optional: true, nullable: false
|
|
19
20
|
field :invoice_url, -> { String }, optional: true, nullable: false
|
|
20
21
|
field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
|
|
21
22
|
field :period_end, -> { Integer }, optional: false, nullable: false
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Types
|
|
5
|
+
class ClerkIntegrationConfig < Internal::Types::Model
|
|
6
|
+
field :first_events_received, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
7
|
+
field :webhook_url, -> { String }, optional: true, nullable: false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Types
|
|
5
|
+
class CompanyPlanCreditGrantView < Internal::Types::Model
|
|
6
|
+
field :billing_credit_auto_topup_amount, -> { Integer }, optional: true, nullable: false
|
|
7
|
+
field :billing_credit_auto_topup_amount_type, -> { String }, optional: true, nullable: false
|
|
8
|
+
field :billing_credit_auto_topup_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
9
|
+
field :billing_credit_auto_topup_expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: true, nullable: false
|
|
10
|
+
field :billing_credit_auto_topup_expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: true, nullable: false
|
|
11
|
+
field :billing_credit_auto_topup_expiry_unit_count, -> { Integer }, optional: true, nullable: false
|
|
12
|
+
field :billing_credit_auto_topup_self_service, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
13
|
+
field :billing_credit_auto_topup_threshold_credits, -> { Integer }, optional: true, nullable: false
|
|
14
|
+
field :billing_credit_auto_topup_threshold_percent, -> { Integer }, optional: true, nullable: false
|
|
15
|
+
field :company_auto_topup_amount, -> { Integer }, optional: true, nullable: false
|
|
16
|
+
field :company_auto_topup_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
17
|
+
field :company_auto_topup_threshold_credits, -> { Integer }, optional: true, nullable: false
|
|
18
|
+
field :created_at, -> { String }, optional: false, nullable: false
|
|
19
|
+
field :credit, -> { Schematic::Types::BillingCreditView }, optional: true, nullable: false
|
|
20
|
+
field :credit_amount, -> { Integer }, optional: false, nullable: false
|
|
21
|
+
field :credit_description, -> { String }, optional: false, nullable: false
|
|
22
|
+
field :credit_icon, -> { String }, optional: true, nullable: false
|
|
23
|
+
field :credit_id, -> { String }, optional: false, nullable: false
|
|
24
|
+
field :credit_name, -> { String }, optional: false, nullable: false
|
|
25
|
+
field :expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: true, nullable: false
|
|
26
|
+
field :expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: true, nullable: false
|
|
27
|
+
field :expiry_unit_count, -> { Integer }, optional: true, nullable: false
|
|
28
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
29
|
+
field :plan, -> { Schematic::Types::GenericPreviewObject }, optional: true, nullable: false
|
|
30
|
+
field :plan_id, -> { String }, optional: false, nullable: false
|
|
31
|
+
field :plan_version_id, -> { String }, optional: true, nullable: false
|
|
32
|
+
field :plural_name, -> { String }, optional: true, nullable: false
|
|
33
|
+
field :reset_cadence, -> { Schematic::Types::BillingPlanCreditGrantResetCadence }, optional: true, nullable: false
|
|
34
|
+
field :reset_start, -> { Schematic::Types::BillingPlanCreditGrantResetStart }, optional: true, nullable: false
|
|
35
|
+
field :reset_type, -> { Schematic::Types::BillingPlanCreditGrantResetType }, optional: false, nullable: false
|
|
36
|
+
field :singular_name, -> { String }, optional: true, nullable: false
|
|
37
|
+
field :updated_at, -> { String }, optional: false, nullable: false
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -5,8 +5,10 @@ module Schematic
|
|
|
5
5
|
class CompanyPlanDetailResponseData < Internal::Types::Model
|
|
6
6
|
field :active_version, -> { Schematic::Types::PlanVersionResponseData }, optional: true, nullable: false
|
|
7
7
|
field :audience_type, -> { String }, optional: true, nullable: false
|
|
8
|
+
field :available_periods, -> { Internal::Types::Array[Schematic::Types::PlanPriceCadence] }, optional: false, nullable: false
|
|
8
9
|
field :billing_linked_resource, -> { Schematic::Types::BillingLinkedResourceResponseData }, optional: true, nullable: false
|
|
9
10
|
field :billing_product, -> { Schematic::Types::BillingProductDetailResponseData }, optional: true, nullable: false
|
|
11
|
+
field :billing_strategy, -> { Schematic::Types::BillingStrategy }, optional: false, nullable: false
|
|
10
12
|
field :charge_type, -> { Schematic::Types::ChargeType }, optional: false, nullable: false
|
|
11
13
|
field :company_can_trial, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
12
14
|
field :company_count, -> { Integer }, optional: false, nullable: false
|
|
@@ -22,7 +24,7 @@ module Schematic
|
|
|
22
24
|
field :custom_plan_config, -> { Schematic::Types::CustomPlanConfig }, optional: true, nullable: false
|
|
23
25
|
field :description, -> { String }, optional: false, nullable: false
|
|
24
26
|
field :draft_version, -> { Schematic::Types::PlanVersionResponseData }, optional: true, nullable: false
|
|
25
|
-
field :entitlements, -> { Internal::Types::Array[Schematic::Types::PlanEntitlementResponseData] }, optional:
|
|
27
|
+
field :entitlements, -> { Internal::Types::Array[Schematic::Types::PlanEntitlementResponseData] }, optional: true, nullable: false
|
|
26
28
|
field :features, -> { Internal::Types::Array[Schematic::Types::FeatureInPlanResponseData] }, optional: false, nullable: false
|
|
27
29
|
field :icon, -> { Schematic::Types::PlanIcon }, optional: false, nullable: false
|
|
28
30
|
field :id, -> { String }, optional: false, nullable: false
|
|
@@ -36,6 +38,7 @@ module Schematic
|
|
|
36
38
|
field :name, -> { String }, optional: false, nullable: false
|
|
37
39
|
field :one_time_price, -> { Schematic::Types::BillingPriceResponseData }, optional: true, nullable: false
|
|
38
40
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: false, nullable: false
|
|
41
|
+
field :quarterly_price, -> { Schematic::Types::BillingPriceResponseData }, optional: true, nullable: false
|
|
39
42
|
field :trial_days, -> { Integer }, optional: true, nullable: false
|
|
40
43
|
field :updated_at, -> { String }, optional: false, nullable: false
|
|
41
44
|
field :usage_violations, -> { Internal::Types::Array[Schematic::Types::FeatureUsageResponseData] }, optional: false, nullable: false
|
|
@@ -9,7 +9,7 @@ module Schematic
|
|
|
9
9
|
field :description, -> { String }, optional: true, nullable: false
|
|
10
10
|
field :id, -> { String }, optional: false, nullable: false
|
|
11
11
|
field :image_url, -> { String }, optional: true, nullable: false
|
|
12
|
-
field :included_credit_grants, -> { Internal::Types::Array[Schematic::Types::
|
|
12
|
+
field :included_credit_grants, -> { Internal::Types::Array[Schematic::Types::CompanyPlanCreditGrantView] }, optional: false, nullable: false
|
|
13
13
|
field :name, -> { String }, optional: false, nullable: false
|
|
14
14
|
field :plan_period, -> { String }, optional: true, nullable: false
|
|
15
15
|
field :plan_price, -> { Integer }, optional: true, nullable: false
|
|
@@ -10,6 +10,7 @@ module Schematic
|
|
|
10
10
|
field :auto_topup_expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: true, nullable: false
|
|
11
11
|
field :auto_topup_expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: true, nullable: false
|
|
12
12
|
field :auto_topup_expiry_unit_count, -> { Integer }, optional: true, nullable: false
|
|
13
|
+
field :auto_topup_self_service, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
13
14
|
field :auto_topup_threshold_credits, -> { Integer }, optional: true, nullable: false
|
|
14
15
|
field :auto_topup_threshold_percent, -> { Integer }, optional: true, nullable: false
|
|
15
16
|
field :credit_amount, -> { Integer }, optional: false, nullable: false
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Types
|
|
5
|
+
class CreateCustomPlanBundlePlanRequestBody < Internal::Types::Model
|
|
6
|
+
field :company_id, -> { String }, optional: false, nullable: false
|
|
7
|
+
field :description, -> { String }, optional: false, nullable: false
|
|
8
|
+
field :icon, -> { Schematic::Types::PlanIcon }, optional: true, nullable: false
|
|
9
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -20,8 +20,13 @@ module Schematic
|
|
|
20
20
|
field :plan_version_id, -> { String }, optional: true, nullable: false
|
|
21
21
|
field :price_behavior, -> { Schematic::Types::EntitlementPriceBehavior }, optional: true, nullable: false
|
|
22
22
|
field :price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
23
|
+
field :quarterly_metered_price_id, -> { String }, optional: true, nullable: false
|
|
24
|
+
field :quarterly_price_tiers, -> { Internal::Types::Array[Schematic::Types::CreatePriceTierRequestBody] }, optional: true, nullable: false
|
|
25
|
+
field :quarterly_unit_price, -> { Integer }, optional: true, nullable: false
|
|
26
|
+
field :quarterly_unit_price_decimal, -> { String }, optional: true, nullable: false
|
|
23
27
|
field :soft_limit, -> { Integer }, optional: true, nullable: false
|
|
24
28
|
field :tier_mode, -> { Schematic::Types::BillingTiersMode }, optional: true, nullable: false
|
|
29
|
+
field :usage_quantity, -> { Integer }, optional: true, nullable: false
|
|
25
30
|
field :value_bool, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
26
31
|
field :value_credit_id, -> { String }, optional: true, nullable: false
|
|
27
32
|
field :value_numeric, -> { Integer }, optional: true, nullable: false
|