schematichq 1.4.0 → 1.4.1
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 +4 -4
- data/lib/schematic/accounts/client.rb +76 -0
- data/lib/schematic/{companies/types/update_plan_trait_response.rb → accounts/types/get_account_member_response.rb} +3 -3
- data/lib/schematic/accounts/types/list_account_members_params.rb +15 -0
- data/lib/schematic/accounts/types/list_account_members_request.rb +14 -0
- data/lib/schematic/accounts/types/list_account_members_response.rb +12 -0
- data/lib/schematic/billing/types/create_billing_price_request_body.rb +1 -0
- data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +1 -0
- data/lib/schematic/billing/types/create_meter_request_body.rb +1 -0
- data/lib/schematic/cache.rb +7 -4
- data/lib/schematic/client.rb +11 -1
- data/lib/schematic/companies/client.rb +8 -105
- 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/companies/types/list_plan_changes_params.rb +2 -2
- data/lib/schematic/companies/types/list_plan_changes_request.rb +2 -2
- data/lib/schematic/credits/client.rb +38 -0
- data/lib/schematic/credits/types/list_company_credit_balances_params.rb +12 -0
- data/lib/schematic/credits/types/list_company_credit_balances_request.rb +11 -0
- data/lib/schematic/credits/types/list_company_credit_balances_response.rb +12 -0
- data/lib/schematic/datastream/client.rb +28 -21
- data/lib/schematic/entitlements/client.rb +32 -0
- data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +40 -0
- data/lib/schematic/entitlements/types/create_company_override_request_body.rb +2 -2
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +2 -2
- data/lib/schematic/entitlements/types/update_company_override_request_body.rb +2 -2
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +2 -2
- data/lib/schematic/entitlements/types/upsert_plan_entitlement_for_billing_product_response.rb +12 -0
- data/lib/schematic/features/client.rb +46 -14
- data/lib/schematic/features/types/count_features_request.rb +3 -3
- data/lib/schematic/features/types/create_billing_linked_feature_request_body.rb +23 -0
- data/lib/schematic/features/types/create_feature_request_body.rb +1 -1
- data/lib/schematic/features/types/list_features_request.rb +3 -3
- data/lib/schematic/features/types/update_feature_request_body.rb +1 -1
- data/lib/schematic/features/types/upsert_feature_for_billing_product_response.rb +12 -0
- data/lib/schematic/insights/client.rb +251 -0
- data/lib/schematic/insights/types/get_activity_params.rb +12 -0
- data/lib/schematic/insights/types/get_activity_request.rb +11 -0
- data/lib/schematic/insights/types/get_activity_response.rb +12 -0
- data/lib/schematic/insights/types/get_environment_feature_usage_time_series_params.rb +15 -0
- data/lib/schematic/insights/types/get_environment_feature_usage_time_series_request.rb +14 -0
- data/lib/schematic/insights/types/get_environment_feature_usage_time_series_response.rb +12 -0
- data/lib/schematic/insights/types/get_environment_trait_usage_time_series_params.rb +15 -0
- data/lib/schematic/insights/types/get_environment_trait_usage_time_series_request.rb +14 -0
- data/lib/schematic/insights/types/get_environment_trait_usage_time_series_response.rb +12 -0
- data/lib/schematic/insights/types/get_plan_growth_params.rb +12 -0
- data/lib/schematic/insights/types/get_plan_growth_request.rb +11 -0
- data/lib/schematic/insights/types/get_plan_growth_response.rb +12 -0
- data/lib/schematic/{companies/types/create_plan_trait_response.rb → insights/types/get_summary_response.rb} +3 -3
- data/lib/schematic/insights/types/get_top_features_by_usage_params.rb +14 -0
- data/lib/schematic/insights/types/get_top_features_by_usage_request.rb +13 -0
- data/lib/schematic/insights/types/get_top_features_by_usage_response.rb +12 -0
- data/lib/schematic/integrationsapi/client.rb +46 -0
- data/lib/schematic/integrationsapi/types/get_integration_webhook_url_response.rb +12 -0
- data/lib/schematic/plans/client.rb +247 -2
- data/lib/schematic/plans/types/count_billing_product_match_companies_params.rb +15 -0
- data/lib/schematic/plans/types/count_billing_product_match_companies_request.rb +14 -0
- data/lib/schematic/plans/types/count_billing_product_match_companies_response.rb +12 -0
- 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 +16 -0
- data/lib/schematic/plans/types/create_custom_plan_request_body.rb +15 -0
- data/lib/schematic/{companies/types/delete_plan_trait_response.rb → plans/types/create_custom_plan_response.rb} +3 -3
- data/lib/schematic/plans/types/list_billing_product_match_companies_params.rb +15 -0
- data/lib/schematic/plans/types/list_billing_product_match_companies_request.rb +14 -0
- data/lib/schematic/plans/types/list_billing_product_match_companies_response.rb +12 -0
- data/lib/schematic/plans/types/list_custom_plan_billings_params.rb +17 -0
- data/lib/schematic/plans/types/list_custom_plan_billings_request.rb +16 -0
- data/lib/schematic/plans/types/list_custom_plan_billings_response.rb +12 -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/publish_plan_version_request_body.rb +4 -0
- data/lib/schematic/plans/types/retry_custom_plan_billing_request_body.rb +15 -0
- data/lib/schematic/plans/types/retry_custom_plan_billing_response.rb +12 -0
- data/lib/schematic/plans/types/upsert_plan_for_billing_product_response.rb +12 -0
- data/lib/schematic/redis_cache.rb +5 -2
- data/lib/schematic/schematic_client.rb +0 -1
- data/lib/schematic/types/account_member_permission.rb +25 -0
- data/lib/schematic/types/account_member_response_data.rb +16 -0
- data/lib/schematic/types/{rulesengine_company_metric_month_reset.rb → account_member_role.rb} +3 -3
- data/lib/schematic/types/activity_entry_response_data.rb +14 -0
- data/lib/schematic/types/activity_response_response_data.rb +9 -0
- data/lib/schematic/types/api_key_create_response_data.rb +1 -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_linked_resource_response_data.rb +11 -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_plan_response_data.rb +1 -1
- data/lib/schematic/types/billing_product_price_response_data.rb +1 -0
- data/lib/schematic/types/billing_provider_type.rb +1 -0
- data/lib/schematic/types/check_flag_response_data.rb +2 -2
- data/lib/schematic/types/checkout_subscription.rb +1 -0
- data/lib/schematic/types/company_credit_balance_response_data.rb +12 -0
- data/lib/schematic/types/company_detail_response_data.rb +1 -0
- data/lib/schematic/types/company_event_period_metrics_response_data.rb +2 -2
- data/lib/schematic/types/company_override_response_data.rb +2 -2
- data/lib/schematic/types/company_plan_detail_response_data.rb +7 -3
- data/lib/schematic/types/company_subscription_response_data.rb +1 -0
- data/lib/schematic/types/{condition_operator.rb → comparable_operator.rb} +4 -4
- data/lib/schematic/types/condition.rb +4 -4
- data/lib/schematic/types/condition_response_data.rb +4 -4
- data/lib/schematic/types/{condition_condition_type.rb → condition_type.rb} +1 -1
- data/lib/schematic/types/condition_view.rb +4 -4
- data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +1 -0
- data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +2 -2
- data/lib/schematic/types/create_entitlement_req_common.rb +2 -2
- data/lib/schematic/types/create_flag_request_body.rb +1 -1
- data/lib/schematic/types/create_or_update_condition_request_body.rb +4 -4
- data/lib/schematic/types/create_or_update_flag_request_body.rb +1 -1
- data/lib/schematic/types/create_or_update_rule_request_body.rb +1 -1
- data/lib/schematic/types/create_plan_request_body.rb +1 -1
- data/lib/schematic/types/custom_plan_activation_strategy.rb +12 -0
- data/lib/schematic/types/custom_plan_billing_response_data.rb +19 -0
- data/lib/schematic/types/custom_plan_billing_status.rb +14 -0
- data/lib/schematic/types/datastream_company_plan.rb +1 -0
- data/lib/schematic/types/environment_feature_usage_time_series_response_data.rb +11 -0
- data/lib/schematic/types/environment_trait_usage_time_series_response_data.rb +11 -0
- data/lib/schematic/types/environment_usage_point_response_data.rb +10 -0
- data/lib/schematic/types/feature_company_response_data.rb +3 -3
- data/lib/schematic/types/feature_company_user_response_data.rb +2 -2
- data/lib/schematic/types/feature_detail_response_data.rb +3 -1
- data/lib/schematic/types/feature_entitlement.rb +2 -2
- data/lib/schematic/types/feature_in_plan_response_data.rb +26 -0
- data/lib/schematic/types/feature_response_data.rb +1 -1
- data/lib/schematic/types/feature_usage_response_data.rb +3 -3
- data/lib/schematic/types/feature_view.rb +1 -1
- data/lib/schematic/types/flag_detail_response_data.rb +2 -1
- data/lib/schematic/types/flag_in_plan_response_data.rb +21 -0
- data/lib/schematic/types/flag_response_data.rb +1 -1
- data/lib/schematic/types/flag_view.rb +0 -1
- data/lib/schematic/types/insights_summary_response_data.rb +14 -0
- data/lib/schematic/types/{plan_controlled_by_type.rb → integration_type.rb} +4 -2
- data/lib/schematic/types/integration_webhook_url_response_data.rb +10 -0
- data/lib/schematic/types/{condition_metric_period.rb → metric_period.rb} +1 -1
- data/lib/schematic/types/{feature_entitlement_month_reset.rb → metric_period_month_reset.rb} +2 -2
- data/lib/schematic/types/mrr_response_data.rb +10 -0
- data/lib/schematic/types/plan_credit_grant_view.rb +1 -0
- data/lib/schematic/types/plan_detail_response_data.rb +7 -3
- data/lib/schematic/types/plan_entitlement_response_data.rb +3 -2
- data/lib/schematic/types/plan_group_plan_detail_response_data.rb +7 -3
- data/lib/schematic/types/plan_growth_point_response_data.rb +12 -0
- data/lib/schematic/types/plan_growth_response_data.rb +9 -0
- data/lib/schematic/types/plan_icon.rb +35 -0
- data/lib/schematic/types/plan_response_data.rb +3 -1
- data/lib/schematic/types/plan_version_response_data.rb +1 -1
- data/lib/schematic/types/plan_view_public_response_data.rb +7 -3
- data/lib/schematic/types/rule.rb +1 -1
- data/lib/schematic/types/rule_condition_detail_response_data.rb +4 -4
- data/lib/schematic/types/rule_condition_response_data.rb +4 -4
- data/lib/schematic/types/rule_detail_response_data.rb +1 -1
- data/lib/schematic/types/rule_response_data.rb +1 -1
- data/lib/schematic/types/{rule_rule_type.rb → rule_type.rb} +3 -3
- data/lib/schematic/types/rule_view.rb +1 -1
- data/lib/schematic/types/rules_engine_schema_version.rb +1 -1
- data/lib/schematic/types/rulesengine_check_flag_result.rb +2 -2
- data/lib/schematic/types/rulesengine_company_metric.rb +2 -2
- data/lib/schematic/types/rulesengine_condition.rb +4 -4
- data/lib/schematic/types/{rulesengine_condition_condition_type.rb → rulesengine_condition_type.rb} +1 -1
- data/lib/schematic/types/rulesengine_feature_entitlement.rb +2 -2
- data/lib/schematic/types/{feature_entitlement_metric_period.rb → rulesengine_metric_period.rb} +1 -1
- data/lib/schematic/types/{condition_metric_period_month_reset.rb → rulesengine_metric_period_month_reset.rb} +2 -2
- data/lib/schematic/types/rulesengine_rule.rb +1 -1
- data/lib/schematic/types/{rulesengine_rule_rule_type.rb → rulesengine_rule_type.rb} +3 -3
- data/lib/schematic/types/top_feature_by_usage_response_data.rb +14 -0
- data/lib/schematic/types/top_features_by_usage_response_data.rb +9 -0
- data/lib/schematic/types/trial_status.rb +13 -0
- data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +1 -0
- data/lib/schematic/types/update_entitlement_req_common.rb +2 -2
- data/lib/schematic/types/update_plan_request_body.rb +1 -1
- data/lib/schematic/types/usage_based_entitlement_response_data.rb +2 -2
- data/lib/schematic/types/webhook_url.rb +10 -0
- data/lib/schematic/version.rb +1 -1
- data/lib/schematic.rb +85 -48
- data/reference.md +2326 -889
- metadata +82 -45
- data/lib/schematic/companies/types/create_plan_trait_request_body.rb +0 -13
- data/lib/schematic/companies/types/update_plan_trait_request_body.rb +0 -13
- data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period.rb +0 -16
- data/lib/schematic/entitlements/types/create_company_override_request_body_metric_period_month_reset.rb +0 -14
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period.rb +0 -16
- data/lib/schematic/entitlements/types/create_plan_entitlement_request_body_metric_period_month_reset.rb +0 -14
- data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period.rb +0 -16
- data/lib/schematic/entitlements/types/update_company_override_request_body_metric_period_month_reset.rb +0 -14
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period.rb +0 -16
- data/lib/schematic/entitlements/types/update_plan_entitlement_request_body_metric_period_month_reset.rb +0 -14
- data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period.rb +0 -14
- data/lib/schematic/types/create_entitlement_in_bundle_request_body_metric_period_month_reset.rb +0 -12
- data/lib/schematic/types/create_entitlement_req_common_metric_period.rb +0 -14
- data/lib/schematic/types/create_entitlement_req_common_metric_period_month_reset.rb +0 -12
- data/lib/schematic/types/create_or_update_condition_request_body_condition_type.rb +0 -17
- data/lib/schematic/types/create_or_update_condition_request_body_metric_period.rb +0 -14
- data/lib/schematic/types/create_or_update_condition_request_body_metric_period_month_reset.rb +0 -12
- data/lib/schematic/types/create_or_update_condition_request_body_operator.rb +0 -18
- data/lib/schematic/types/create_or_update_rule_request_body_rule_type.rb +0 -15
- data/lib/schematic/types/rulesengine_check_flag_result_feature_usage_period.rb +0 -14
- data/lib/schematic/types/rulesengine_check_flag_result_rule_type.rb +0 -17
- data/lib/schematic/types/rulesengine_company_metric_period.rb +0 -14
- data/lib/schematic/types/rulesengine_condition_metric_period.rb +0 -14
- data/lib/schematic/types/rulesengine_condition_metric_period_month_reset.rb +0 -12
- data/lib/schematic/types/rulesengine_condition_operator.rb +0 -18
- data/lib/schematic/types/rulesengine_feature_entitlement_metric_period.rb +0 -14
- data/lib/schematic/types/rulesengine_feature_entitlement_month_reset.rb +0 -12
- data/lib/schematic/types/update_entitlement_req_common_metric_period.rb +0 -14
- data/lib/schematic/types/update_entitlement_req_common_metric_period_month_reset.rb +0 -12
|
@@ -55,6 +55,124 @@ module Schematic
|
|
|
55
55
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
56
56
|
# @option request_options [Integer] :timeout_in_seconds
|
|
57
57
|
# @option params [String, nil] :company_id
|
|
58
|
+
# @option params [String, nil] :plan_id
|
|
59
|
+
# @option params [Schematic::Types::CustomPlanBillingStatus, nil] :status
|
|
60
|
+
# @option params [Schematic::Types::CustomPlanBillingStatus, nil] :statuses
|
|
61
|
+
# @option params [Integer, nil] :limit
|
|
62
|
+
# @option params [Integer, nil] :offset
|
|
63
|
+
#
|
|
64
|
+
# @return [Schematic::Plans::Types::ListCustomPlanBillingsResponse]
|
|
65
|
+
def list_custom_plan_billings(request_options: {}, **params)
|
|
66
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
67
|
+
query_param_names = %i[company_id plan_id status statuses limit offset]
|
|
68
|
+
query_params = {}
|
|
69
|
+
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
70
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
71
|
+
query_params["status"] = params[:status] if params.key?(:status)
|
|
72
|
+
query_params["statuses"] = params[:statuses] if params.key?(:statuses)
|
|
73
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
74
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
75
|
+
params.except(*query_param_names)
|
|
76
|
+
|
|
77
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
78
|
+
base_url: request_options[:base_url],
|
|
79
|
+
method: "GET",
|
|
80
|
+
path: "custom-plan-billings",
|
|
81
|
+
query: query_params,
|
|
82
|
+
request_options: request_options
|
|
83
|
+
)
|
|
84
|
+
begin
|
|
85
|
+
response = @client.send(request)
|
|
86
|
+
rescue Net::HTTPRequestTimeout
|
|
87
|
+
raise Schematic::Errors::TimeoutError
|
|
88
|
+
end
|
|
89
|
+
code = response.code.to_i
|
|
90
|
+
if code.between?(200, 299)
|
|
91
|
+
Schematic::Plans::Types::ListCustomPlanBillingsResponse.load(response.body)
|
|
92
|
+
else
|
|
93
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
94
|
+
raise error_class.new(response.body, code: code)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# @param request_options [Hash]
|
|
99
|
+
# @param params [Schematic::Plans::Types::RetryCustomPlanBillingRequestBody]
|
|
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::RetryCustomPlanBillingResponse]
|
|
108
|
+
def retry_custom_plan_billing(request_options: {}, **params)
|
|
109
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
110
|
+
request_data = Schematic::Plans::Types::RetryCustomPlanBillingRequestBody.new(params).to_h
|
|
111
|
+
non_body_param_names = ["custom_plan_billing_id"]
|
|
112
|
+
body = request_data.except(*non_body_param_names)
|
|
113
|
+
|
|
114
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
115
|
+
base_url: request_options[:base_url],
|
|
116
|
+
method: "PUT",
|
|
117
|
+
path: "custom-plan-billings/#{URI.encode_uri_component(params[:custom_plan_billing_id].to_s)}/retry",
|
|
118
|
+
body: body,
|
|
119
|
+
request_options: request_options
|
|
120
|
+
)
|
|
121
|
+
begin
|
|
122
|
+
response = @client.send(request)
|
|
123
|
+
rescue Net::HTTPRequestTimeout
|
|
124
|
+
raise Schematic::Errors::TimeoutError
|
|
125
|
+
end
|
|
126
|
+
code = response.code.to_i
|
|
127
|
+
if code.between?(200, 299)
|
|
128
|
+
Schematic::Plans::Types::RetryCustomPlanBillingResponse.load(response.body)
|
|
129
|
+
else
|
|
130
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
131
|
+
raise error_class.new(response.body, code: code)
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# @param request_options [Hash]
|
|
136
|
+
# @param params [Schematic::Plans::Types::CreateCustomPlanRequestBody]
|
|
137
|
+
# @option request_options [String] :base_url
|
|
138
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
139
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
140
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
141
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
142
|
+
#
|
|
143
|
+
# @return [Schematic::Plans::Types::CreateCustomPlanResponse]
|
|
144
|
+
def create_custom_plan(request_options: {}, **params)
|
|
145
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
146
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
147
|
+
base_url: request_options[:base_url],
|
|
148
|
+
method: "POST",
|
|
149
|
+
path: "custom-plans",
|
|
150
|
+
body: Schematic::Plans::Types::CreateCustomPlanRequestBody.new(params).to_h,
|
|
151
|
+
request_options: request_options
|
|
152
|
+
)
|
|
153
|
+
begin
|
|
154
|
+
response = @client.send(request)
|
|
155
|
+
rescue Net::HTTPRequestTimeout
|
|
156
|
+
raise Schematic::Errors::TimeoutError
|
|
157
|
+
end
|
|
158
|
+
code = response.code.to_i
|
|
159
|
+
if code.between?(200, 299)
|
|
160
|
+
Schematic::Plans::Types::CreateCustomPlanResponse.load(response.body)
|
|
161
|
+
else
|
|
162
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
163
|
+
raise error_class.new(response.body, code: code)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# @param request_options [Hash]
|
|
168
|
+
# @param params [Hash]
|
|
169
|
+
# @option request_options [String] :base_url
|
|
170
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
171
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
172
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
173
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
174
|
+
# @option params [String, nil] :company_id
|
|
175
|
+
# @option params [Boolean, nil] :exclude_company_scoped
|
|
58
176
|
# @option params [Boolean, nil] :for_fallback_plan
|
|
59
177
|
# @option params [Boolean, nil] :for_initial_plan
|
|
60
178
|
# @option params [Boolean, nil] :for_trial_expiry_plan
|
|
@@ -63,6 +181,7 @@ module Schematic
|
|
|
63
181
|
# @option params [Boolean, nil] :include_draft_versions
|
|
64
182
|
# @option params [Schematic::Types::PlanType, nil] :plan_type
|
|
65
183
|
# @option params [String, nil] :q
|
|
184
|
+
# @option params [String, nil] :scoped_to_company_id
|
|
66
185
|
# @option params [String, nil] :without_entitlement_for
|
|
67
186
|
# @option params [Boolean, nil] :without_paid_product_id
|
|
68
187
|
# @option params [Integer, nil] :limit
|
|
@@ -71,9 +190,10 @@ module Schematic
|
|
|
71
190
|
# @return [Schematic::Plans::Types::ListPlansResponse]
|
|
72
191
|
def list_plans(request_options: {}, **params)
|
|
73
192
|
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
74
|
-
query_param_names = %i[company_id for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q without_entitlement_for without_paid_product_id limit offset]
|
|
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]
|
|
75
194
|
query_params = {}
|
|
76
195
|
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
196
|
+
query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
|
|
77
197
|
query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
|
|
78
198
|
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
|
|
79
199
|
query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
|
|
@@ -82,6 +202,7 @@ module Schematic
|
|
|
82
202
|
query_params["include_draft_versions"] = params[:include_draft_versions] if params.key?(:include_draft_versions)
|
|
83
203
|
query_params["plan_type"] = params[:plan_type] if params.key?(:plan_type)
|
|
84
204
|
query_params["q"] = params[:q] if params.key?(:q)
|
|
205
|
+
query_params["scoped_to_company_id"] = params[:scoped_to_company_id] if params.key?(:scoped_to_company_id)
|
|
85
206
|
query_params["without_entitlement_for"] = params[:without_entitlement_for] if params.key?(:without_entitlement_for)
|
|
86
207
|
query_params["without_paid_product_id"] = params[:without_paid_product_id] if params.key?(:without_paid_product_id)
|
|
87
208
|
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
@@ -278,6 +399,126 @@ module Schematic
|
|
|
278
399
|
end
|
|
279
400
|
end
|
|
280
401
|
|
|
402
|
+
# @param request_options [Hash]
|
|
403
|
+
# @param params [Schematic::Plans::Types::CreateBillingLinkedPlanRequestBody]
|
|
404
|
+
# @option request_options [String] :base_url
|
|
405
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
406
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
407
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
408
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
409
|
+
#
|
|
410
|
+
# @return [Schematic::Plans::Types::UpsertPlanForBillingProductResponse]
|
|
411
|
+
def upsert_plan_for_billing_product(request_options: {}, **params)
|
|
412
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
413
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
414
|
+
base_url: request_options[:base_url],
|
|
415
|
+
method: "POST",
|
|
416
|
+
path: "plans/billing-linked",
|
|
417
|
+
body: Schematic::Plans::Types::CreateBillingLinkedPlanRequestBody.new(params).to_h,
|
|
418
|
+
request_options: request_options
|
|
419
|
+
)
|
|
420
|
+
begin
|
|
421
|
+
response = @client.send(request)
|
|
422
|
+
rescue Net::HTTPRequestTimeout
|
|
423
|
+
raise Schematic::Errors::TimeoutError
|
|
424
|
+
end
|
|
425
|
+
code = response.code.to_i
|
|
426
|
+
if code.between?(200, 299)
|
|
427
|
+
Schematic::Plans::Types::UpsertPlanForBillingProductResponse.load(response.body)
|
|
428
|
+
else
|
|
429
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
430
|
+
raise error_class.new(response.body, code: code)
|
|
431
|
+
end
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
# @param request_options [Hash]
|
|
435
|
+
# @param params [Hash]
|
|
436
|
+
# @option request_options [String] :base_url
|
|
437
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
438
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
439
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
440
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
441
|
+
# @option params [String] :plan_id
|
|
442
|
+
# @option params [String, nil] :q
|
|
443
|
+
# @option params [Integer, nil] :limit
|
|
444
|
+
# @option params [Integer, nil] :offset
|
|
445
|
+
#
|
|
446
|
+
# @return [Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse]
|
|
447
|
+
def list_billing_product_match_companies(request_options: {}, **params)
|
|
448
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
449
|
+
query_param_names = %i[plan_id q limit offset]
|
|
450
|
+
query_params = {}
|
|
451
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
452
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
453
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
454
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
455
|
+
params.except(*query_param_names)
|
|
456
|
+
|
|
457
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
458
|
+
base_url: request_options[:base_url],
|
|
459
|
+
method: "GET",
|
|
460
|
+
path: "plans/billing-product-match-companies",
|
|
461
|
+
query: query_params,
|
|
462
|
+
request_options: request_options
|
|
463
|
+
)
|
|
464
|
+
begin
|
|
465
|
+
response = @client.send(request)
|
|
466
|
+
rescue Net::HTTPRequestTimeout
|
|
467
|
+
raise Schematic::Errors::TimeoutError
|
|
468
|
+
end
|
|
469
|
+
code = response.code.to_i
|
|
470
|
+
if code.between?(200, 299)
|
|
471
|
+
Schematic::Plans::Types::ListBillingProductMatchCompaniesResponse.load(response.body)
|
|
472
|
+
else
|
|
473
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
474
|
+
raise error_class.new(response.body, code: code)
|
|
475
|
+
end
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
# @param request_options [Hash]
|
|
479
|
+
# @param params [Hash]
|
|
480
|
+
# @option request_options [String] :base_url
|
|
481
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
482
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
483
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
484
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
485
|
+
# @option params [String] :plan_id
|
|
486
|
+
# @option params [String, nil] :q
|
|
487
|
+
# @option params [Integer, nil] :limit
|
|
488
|
+
# @option params [Integer, nil] :offset
|
|
489
|
+
#
|
|
490
|
+
# @return [Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse]
|
|
491
|
+
def count_billing_product_match_companies(request_options: {}, **params)
|
|
492
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
493
|
+
query_param_names = %i[plan_id q limit offset]
|
|
494
|
+
query_params = {}
|
|
495
|
+
query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id)
|
|
496
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
497
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
498
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
499
|
+
params.except(*query_param_names)
|
|
500
|
+
|
|
501
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
502
|
+
base_url: request_options[:base_url],
|
|
503
|
+
method: "GET",
|
|
504
|
+
path: "plans/billing-product-match-companies/count",
|
|
505
|
+
query: query_params,
|
|
506
|
+
request_options: request_options
|
|
507
|
+
)
|
|
508
|
+
begin
|
|
509
|
+
response = @client.send(request)
|
|
510
|
+
rescue Net::HTTPRequestTimeout
|
|
511
|
+
raise Schematic::Errors::TimeoutError
|
|
512
|
+
end
|
|
513
|
+
code = response.code.to_i
|
|
514
|
+
if code.between?(200, 299)
|
|
515
|
+
Schematic::Plans::Types::CountBillingProductMatchCompaniesResponse.load(response.body)
|
|
516
|
+
else
|
|
517
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
518
|
+
raise error_class.new(response.body, code: code)
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
281
522
|
# @param request_options [Hash]
|
|
282
523
|
# @param params [Hash]
|
|
283
524
|
# @option request_options [String] :base_url
|
|
@@ -286,6 +527,7 @@ module Schematic
|
|
|
286
527
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
287
528
|
# @option request_options [Integer] :timeout_in_seconds
|
|
288
529
|
# @option params [String, nil] :company_id
|
|
530
|
+
# @option params [Boolean, nil] :exclude_company_scoped
|
|
289
531
|
# @option params [Boolean, nil] :for_fallback_plan
|
|
290
532
|
# @option params [Boolean, nil] :for_initial_plan
|
|
291
533
|
# @option params [Boolean, nil] :for_trial_expiry_plan
|
|
@@ -294,6 +536,7 @@ module Schematic
|
|
|
294
536
|
# @option params [Boolean, nil] :include_draft_versions
|
|
295
537
|
# @option params [Schematic::Types::PlanType, nil] :plan_type
|
|
296
538
|
# @option params [String, nil] :q
|
|
539
|
+
# @option params [String, nil] :scoped_to_company_id
|
|
297
540
|
# @option params [String, nil] :without_entitlement_for
|
|
298
541
|
# @option params [Boolean, nil] :without_paid_product_id
|
|
299
542
|
# @option params [Integer, nil] :limit
|
|
@@ -302,9 +545,10 @@ module Schematic
|
|
|
302
545
|
# @return [Schematic::Plans::Types::CountPlansResponse]
|
|
303
546
|
def count_plans(request_options: {}, **params)
|
|
304
547
|
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
305
|
-
query_param_names = %i[company_id for_fallback_plan for_initial_plan for_trial_expiry_plan has_product_id ids include_draft_versions plan_type q without_entitlement_for without_paid_product_id limit offset]
|
|
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]
|
|
306
549
|
query_params = {}
|
|
307
550
|
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
551
|
+
query_params["exclude_company_scoped"] = params[:exclude_company_scoped] if params.key?(:exclude_company_scoped)
|
|
308
552
|
query_params["for_fallback_plan"] = params[:for_fallback_plan] if params.key?(:for_fallback_plan)
|
|
309
553
|
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
|
|
310
554
|
query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
|
|
@@ -313,6 +557,7 @@ module Schematic
|
|
|
313
557
|
query_params["include_draft_versions"] = params[:include_draft_versions] if params.key?(:include_draft_versions)
|
|
314
558
|
query_params["plan_type"] = params[:plan_type] if params.key?(:plan_type)
|
|
315
559
|
query_params["q"] = params[:q] if params.key?(:q)
|
|
560
|
+
query_params["scoped_to_company_id"] = params[:scoped_to_company_id] if params.key?(:scoped_to_company_id)
|
|
316
561
|
query_params["without_entitlement_for"] = params[:without_entitlement_for] if params.key?(:without_entitlement_for)
|
|
317
562
|
query_params["without_paid_product_id"] = params[:without_paid_product_id] if params.key?(:without_paid_product_id)
|
|
318
563
|
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
# Input parameters
|
|
7
|
+
class CountBillingProductMatchCompaniesParams < Internal::Types::Model
|
|
8
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
9
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
10
|
+
field :plan_id, -> { String }, optional: true, nullable: false
|
|
11
|
+
field :q, -> { String }, 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 Plans
|
|
5
|
+
module Types
|
|
6
|
+
class CountBillingProductMatchCompaniesRequest < Internal::Types::Model
|
|
7
|
+
field :plan_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
field :q, -> { String }, 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 Plans
|
|
5
|
+
module Types
|
|
6
|
+
class CountBillingProductMatchCompaniesResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::CountResponse }, optional: false, nullable: false
|
|
8
|
+
field :params, -> { Schematic::Plans::Types::CountBillingProductMatchCompaniesParams }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -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 :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
|
|
11
12
|
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -16,6 +17,7 @@ module Schematic
|
|
|
16
17
|
field :offset, -> { Integer }, optional: true, nullable: false
|
|
17
18
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
18
19
|
field :q, -> { String }, optional: true, nullable: false
|
|
20
|
+
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
19
21
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
20
22
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
21
23
|
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 :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
8
9
|
field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
9
10
|
field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
10
11
|
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -13,6 +14,7 @@ module Schematic
|
|
|
13
14
|
field :include_draft_versions, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
14
15
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
15
16
|
field :q, -> { String }, optional: true, nullable: false
|
|
17
|
+
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
16
18
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
17
19
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
18
20
|
field :limit, -> { Integer }, optional: true, nullable: false
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class CreateBillingLinkedPlanRequestBody < Internal::Types::Model
|
|
7
|
+
field :billing_provider, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
|
|
8
|
+
field :description, -> { String }, optional: false, nullable: false
|
|
9
|
+
field :external_resource_id, -> { String }, optional: false, nullable: false
|
|
10
|
+
field :icon, -> { Schematic::Types::PlanIcon }, optional: true, nullable: false
|
|
11
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
12
|
+
field :plan_type, -> { Schematic::Types::PlanType }, optional: false, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class CreateCustomPlanRequestBody < Internal::Types::Model
|
|
7
|
+
field :company_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
field :copied_from_plan_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
field :description, -> { String }, optional: false, nullable: false
|
|
10
|
+
field :icon, -> { Schematic::Types::PlanIcon }, optional: true, nullable: false
|
|
11
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Schematic
|
|
4
|
-
module
|
|
4
|
+
module Plans
|
|
5
5
|
module Types
|
|
6
|
-
class
|
|
7
|
-
field :data, -> { Schematic::Types::
|
|
6
|
+
class CreateCustomPlanResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::PlanDetailResponseData }, optional: false, nullable: false
|
|
8
8
|
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
# Input parameters
|
|
7
|
+
class ListBillingProductMatchCompaniesParams < Internal::Types::Model
|
|
8
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
9
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
10
|
+
field :plan_id, -> { String }, optional: true, nullable: false
|
|
11
|
+
field :q, -> { String }, 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 Plans
|
|
5
|
+
module Types
|
|
6
|
+
class ListBillingProductMatchCompaniesRequest < Internal::Types::Model
|
|
7
|
+
field :plan_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
field :q, -> { String }, 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 Plans
|
|
5
|
+
module Types
|
|
6
|
+
class ListBillingProductMatchCompaniesResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Internal::Types::Array[Schematic::Types::CompanyDetailResponseData] }, optional: false, nullable: false
|
|
8
|
+
field :params, -> { Schematic::Plans::Types::ListBillingProductMatchCompaniesParams }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
# Input parameters
|
|
7
|
+
class ListCustomPlanBillingsParams < Internal::Types::Model
|
|
8
|
+
field :company_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
10
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
11
|
+
field :plan_id, -> { String }, optional: true, nullable: false
|
|
12
|
+
field :status, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
|
|
13
|
+
field :statuses, -> { Internal::Types::Array[Schematic::Types::CustomPlanBillingStatus] }, optional: true, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class ListCustomPlanBillingsRequest < Internal::Types::Model
|
|
7
|
+
field :company_id, -> { String }, optional: true, nullable: false
|
|
8
|
+
field :plan_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
field :status, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
|
|
10
|
+
field :statuses, -> { Schematic::Types::CustomPlanBillingStatus }, optional: true, nullable: false
|
|
11
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
12
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class ListCustomPlanBillingsResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Internal::Types::Array[Schematic::Types::CustomPlanBillingResponseData] }, optional: false, nullable: false
|
|
8
|
+
field :params, -> { Schematic::Plans::Types::ListCustomPlanBillingsParams }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -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 :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
|
|
11
12
|
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -16,6 +17,7 @@ module Schematic
|
|
|
16
17
|
field :offset, -> { Integer }, optional: true, nullable: false
|
|
17
18
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
18
19
|
field :q, -> { String }, optional: true, nullable: false
|
|
20
|
+
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
19
21
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
20
22
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
21
23
|
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 :exclude_company_scoped, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
8
9
|
field :for_fallback_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
9
10
|
field :for_initial_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
10
11
|
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
@@ -13,6 +14,7 @@ module Schematic
|
|
|
13
14
|
field :include_draft_versions, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
14
15
|
field :plan_type, -> { Schematic::Types::PlanType }, optional: true, nullable: false
|
|
15
16
|
field :q, -> { String }, optional: true, nullable: false
|
|
17
|
+
field :scoped_to_company_id, -> { String }, optional: true, nullable: false
|
|
16
18
|
field :without_entitlement_for, -> { String }, optional: true, nullable: false
|
|
17
19
|
field :without_paid_product_id, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
18
20
|
field :limit, -> { Integer }, optional: true, nullable: false
|
|
@@ -5,8 +5,12 @@ module Schematic
|
|
|
5
5
|
module Types
|
|
6
6
|
class PublishPlanVersionRequestBody < Internal::Types::Model
|
|
7
7
|
field :plan_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
field :activation_strategy, -> { Schematic::Types::CustomPlanActivationStrategy }, optional: true, nullable: false
|
|
9
|
+
field :customer_email, -> { String }, optional: true, nullable: false
|
|
10
|
+
field :days_until_due, -> { Integer }, optional: true, nullable: false
|
|
8
11
|
field :excluded_company_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
|
|
9
12
|
field :migration_strategy, -> { Schematic::Types::PlanVersionMigrationStrategy }, optional: false, nullable: false
|
|
13
|
+
field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
|
|
10
14
|
end
|
|
11
15
|
end
|
|
12
16
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class RetryCustomPlanBillingRequestBody < Internal::Types::Model
|
|
7
|
+
field :custom_plan_billing_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
field :activation_strategy, -> { Schematic::Types::CustomPlanActivationStrategy }, optional: true, nullable: false
|
|
9
|
+
field :customer_email, -> { String }, optional: false, nullable: false
|
|
10
|
+
field :days_until_due, -> { Integer }, optional: true, nullable: false
|
|
11
|
+
field :pay_in_advance, -> { Internal::Types::Array[Schematic::Types::UpdatePayInAdvanceRequestBody] }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class RetryCustomPlanBillingResponse < 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
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Plans
|
|
5
|
+
module Types
|
|
6
|
+
class UpsertPlanForBillingProductResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::PlanDetailResponseData }, optional: false, nullable: false
|
|
8
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -67,11 +67,14 @@ module Schematic
|
|
|
67
67
|
@client.del(full_key)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
# Scans `#{key_prefix}#{scope}*` only, so callers sharing a key_prefix
|
|
71
|
+
# across cache types (e.g. flags/company/user all under "schematic:") do
|
|
72
|
+
# not wipe sibling caches when pruning one of them.
|
|
73
|
+
def delete_missing(keys_to_keep, scope:)
|
|
71
74
|
full_keys_to_keep = keys_to_keep.to_set { |k| prefixed_key(k) }
|
|
72
75
|
keys_to_delete = []
|
|
73
76
|
|
|
74
|
-
@client.scan_each(match: "#{@key_prefix}*", count: BATCH_DELETE_SIZE) do |key|
|
|
77
|
+
@client.scan_each(match: "#{@key_prefix}#{scope}*", count: BATCH_DELETE_SIZE) do |key|
|
|
75
78
|
unless full_keys_to_keep.include?(key)
|
|
76
79
|
keys_to_delete << key
|
|
77
80
|
|
|
@@ -482,7 +482,6 @@ module Schematic
|
|
|
482
482
|
keys.each do |key|
|
|
483
483
|
result = @datastream_client.check_flag(eval_ctx, key)
|
|
484
484
|
response = CheckFlagResponse.new(result)
|
|
485
|
-
enqueue_flag_check_event(key, response, company, user)
|
|
486
485
|
results << { flag: key, value: response.value, reason: response.reason }
|
|
487
486
|
rescue DataStream::EvaluationError => e
|
|
488
487
|
@logger.debug("DataStream check_flags falling back to API: #{e.message}")
|