Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"webrick": ">= 1.0"
}
},
"originGitCommit": "340529eacf4f1dcc5522e771872c1dd94b9c4891",
"sdkVersion": "1.4.11"
"originGitCommit": "a9fc73b97dcfa602bff97a7d41d980a55c9c9030",
"sdkVersion": "1.4.12"
}
12 changes: 9 additions & 3 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
schematichq (1.4.11)
schematichq (1.4.12)
wasmtime (>= 19.0)
websocket (>= 1.2)

Expand All @@ -18,7 +18,7 @@ GEM
rexml
hashdiff (1.2.1)
io-console (0.8.2)
json (2.21.1)
json (2.21.2)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
method_source (1.1.0)
Expand Down
18 changes: 17 additions & 1 deletion lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
require_relative "schematic/types/billing_credit_auto_topup_availability"
require_relative "schematic/types/billing_plan_credit_grant_reset_start"
require_relative "schematic/types/billing_plan_credit_grant_reset_type"
require_relative "schematic/types/plan_credit_grant_scaling"
require_relative "schematic/types/preview_object_response_data"
require_relative "schematic/types/billing_plan_credit_grant_response_data"
require_relative "schematic/credits/types/list_billing_plan_credit_grants_response"
Expand Down Expand Up @@ -313,6 +314,7 @@
require_relative "schematic/checkout/types/preview_checkout_internal_response"
require_relative "schematic/types/company_billing_address_view"
require_relative "schematic/types/company_billing_checkout_settings"
require_relative "schematic/types/company_tax_id_view"
require_relative "schematic/types/company_billing_details_response_data"
require_relative "schematic/checkout/types/get_company_billing_details_response"
require_relative "schematic/checkout/types/update_company_billing_details_response"
Expand Down Expand Up @@ -444,6 +446,16 @@
require_relative "schematic/entitlements/types/duplicate_plan_entitlements_response"
require_relative "schematic/entitlements/types/get_feature_usage_by_company_params"
require_relative "schematic/entitlements/types/get_feature_usage_by_company_response"
require_relative "schematic/entitlements/types/get_user_usage_by_company_params"
require_relative "schematic/types/user_credit_usage_response_data"
require_relative "schematic/types/user_feature_usage_response_data"
require_relative "schematic/types/user_usage_by_company_response_data"
require_relative "schematic/entitlements/types/get_user_usage_by_company_response"
require_relative "schematic/entitlements/types/get_user_usage_detail_params"
require_relative "schematic/types/user_daily_credit_point_response_data"
require_relative "schematic/types/user_daily_usage_point_response_data"
require_relative "schematic/types/user_usage_detail_response_data"
require_relative "schematic/entitlements/types/get_user_usage_detail_response"
require_relative "schematic/plans/types/update_company_plans_response"
require_relative "schematic/plans/types/list_custom_plan_billings_params"
require_relative "schematic/plans/types/list_custom_plan_billings_response"
Expand Down Expand Up @@ -493,6 +505,7 @@
require_relative "schematic/types/company_plan_detail_response_data"
require_relative "schematic/types/compatible_plans"
require_relative "schematic/types/component_capabilities"
require_relative "schematic/types/proration_behavior"
require_relative "schematic/types/component_checkout_settings"
require_relative "schematic/types/component_display_settings"
require_relative "schematic/types/credit_transfer_view"
Expand Down Expand Up @@ -762,7 +775,6 @@
require_relative "schematic/types/plan_bundle_credit_grant_request_body"
require_relative "schematic/types/plan_bundle_entitlement_request_body"
require_relative "schematic/types/plan_currency_price_request_body"
require_relative "schematic/types/proration_behavior"
require_relative "schematic/types/release_credit_lease_request_body"
require_relative "schematic/types/rule_condition_group_response_data"
require_relative "schematic/types/rule_condition_response_data"
Expand All @@ -789,6 +801,8 @@
require_relative "schematic/types/rulesengine_flag"
require_relative "schematic/types/rulesengine_user"
require_relative "schematic/types/scheduled_downgrade_config_behavior"
require_relative "schematic/types/tax_id_type"
require_relative "schematic/types/tax_id_input"
require_relative "schematic/types/temporary_access_token_response_data"
require_relative "schematic/types/update_entitlement_req_common"
require_relative "schematic/types/update_plan_request_body"
Expand Down Expand Up @@ -912,6 +926,8 @@
require_relative "schematic/entitlements/types/count_plan_entitlements_request"
require_relative "schematic/entitlements/types/duplicate_plan_entitlements_request_body"
require_relative "schematic/entitlements/types/get_feature_usage_by_company_request"
require_relative "schematic/entitlements/types/get_user_usage_by_company_request"
require_relative "schematic/entitlements/types/get_user_usage_detail_request"
require_relative "schematic/plans/client"
require_relative "schematic/plans/types/update_company_plans_request_body"
require_relative "schematic/plans/types/list_custom_plan_billings_request"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class CreateApiKeyRequestBody < Internal::Types::Model
field :description, -> { String }, optional: true, nullable: false
field :environment_id, -> { String }, optional: true, nullable: false
field :name, -> { String }, optional: false, nullable: false
field :rate_limit_percent, -> { Integer }, optional: true, nullable: false
field :readonly, -> { Internal::Types::Boolean }, optional: true, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class UpdateApiKeyRequestBody < Internal::Types::Model
field :api_key_id, -> { String }, optional: false, nullable: false
field :description, -> { String }, optional: true, nullable: false
field :name, -> { String }, optional: true, nullable: false
field :rate_limit_percent, -> { Integer }, optional: true, nullable: false
end
end
end
Expand Down
8 changes: 6 additions & 2 deletions lib/schematic/billing/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ def delete_payment_method_by_external_id(request_options: {}, **params)
# @option params [Boolean, nil] :for_trial_expiry_plan
# @option params [String, nil] :ids
# @option params [String, nil] :interval
# @option params [Integer, nil] :interval_count
# @option params [Boolean, nil] :is_active
# @option params [String, nil] :plan_version_id
# @option params [Integer, nil] :price
Expand All @@ -598,13 +599,14 @@ def delete_payment_method_by_external_id(request_options: {}, **params)
# @return [Schematic::Billing::Types::ListBillingPricesResponse]
def list_billing_prices(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval interval_count is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_params = {}
query_params["currency"] = params[:currency] if params.key?(:currency)
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["interval"] = params[:interval] if params.key?(:interval)
query_params["interval_count"] = params[:interval_count] if params.key?(:interval_count)
query_params["is_active"] = params[:is_active] if params.key?(:is_active)
query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
query_params["price"] = params[:price] if params.key?(:price)
Expand Down Expand Up @@ -716,6 +718,7 @@ def delete_billing_product(request_options: {}, **params)
# @option params [Boolean, nil] :for_trial_expiry_plan
# @option params [String, nil] :ids
# @option params [String, nil] :interval
# @option params [Integer, nil] :interval_count
# @option params [Boolean, nil] :is_active
# @option params [String, nil] :plan_version_id
# @option params [Integer, nil] :price
Expand All @@ -732,13 +735,14 @@ def delete_billing_product(request_options: {}, **params)
# @return [Schematic::Billing::Types::ListBillingProductPricesResponse]
def list_billing_product_prices(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval interval_count is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_params = {}
query_params["currency"] = params[:currency] if params.key?(:currency)
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["interval"] = params[:interval] if params.key?(:interval)
query_params["interval_count"] = params[:interval_count] if params.key?(:interval_count)
query_params["is_active"] = params[:is_active] if params.key?(:is_active)
query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
query_params["price"] = params[:price] if params.key?(:price)
Expand Down
1 change: 1 addition & 0 deletions lib/schematic/billing/types/list_billing_prices_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ListBillingPricesParams < Internal::Types::Model
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :interval, -> { String }, optional: true, nullable: false
field :interval_count, -> { Integer }, optional: true, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
Expand Down
1 change: 1 addition & 0 deletions lib/schematic/billing/types/list_billing_prices_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ListBillingPricesRequest < Internal::Types::Model
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :ids, -> { String }, optional: true, nullable: false
field :interval, -> { String }, optional: true, nullable: false
field :interval_count, -> { Integer }, optional: true, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :plan_version_id, -> { String }, optional: true, nullable: false
field :price, -> { Integer }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ListBillingProductPricesParams < Internal::Types::Model
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :interval, -> { String }, optional: true, nullable: false
field :interval_count, -> { Integer }, optional: true, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ListBillingProductPricesRequest < Internal::Types::Model
field :for_trial_expiry_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :ids, -> { String }, optional: true, nullable: false
field :interval, -> { String }, optional: true, nullable: false
field :interval_count, -> { Integer }, optional: true, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :plan_version_id, -> { String }, optional: true, nullable: false
field :price, -> { Integer }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module Catalogs
module Types
class CreateCatalogRequestBody < Internal::Types::Model
field :description, -> { String }, optional: true, nullable: false
field :is_default, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :name, -> { String }, optional: false, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class UpdateCompanyBillingDetailsRequestBody < Internal::Types::Model
field :address, -> { Schematic::Types::CustomerBillingAddress }, optional: true, nullable: false
field :email, -> { String }, optional: true, nullable: false
field :phone, -> { String }, optional: true, nullable: false
field :tax_id, -> { Schematic::Types::TaxIdInput }, optional: true, nullable: false
field :values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/schematic/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(api_key:, base_url: nil)
@raw_client = Schematic::Internal::Http::RawClient.new(
base_url: base_url || Schematic::Environment::DEFAULT,
headers: {
"User-Agent" => "schematichq/1.4.11",
"User-Agent" => "schematichq/1.4.12",
"X-Fern-Language" => "Ruby",
"X-Schematic-Api-Key" => api_key.to_s
}
Expand Down
88 changes: 88 additions & 0 deletions lib/schematic/entitlements/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,94 @@ def get_feature_usage_by_company(request_options: {}, **params)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :company_id
# @option params [String, nil] :end_time
# @option params [String, nil] :feature_id
# @option params [String, nil] :start_time
#
# @return [Schematic::Entitlements::Types::GetUserUsageByCompanyResponse]
def get_user_usage_by_company(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[company_id end_time feature_id start_time]
query_params = {}
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
query_params["end_time"] = params[:end_time] if params.key?(:end_time)
query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id)
query_params["start_time"] = params[:start_time] if params.key?(:start_time)
params.except(*query_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "user-usage-by-company",
query: query_params,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Schematic::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Schematic::Entitlements::Types::GetUserUsageByCompanyResponse.load(response.body)
else
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :company_id
# @option params [String, nil] :end_time
# @option params [String, nil] :start_time
# @option params [String] :user_id
#
# @return [Schematic::Entitlements::Types::GetUserUsageDetailResponse]
def get_user_usage_detail(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[company_id end_time start_time user_id]
query_params = {}
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
query_params["end_time"] = params[:end_time] if params.key?(:end_time)
query_params["start_time"] = params[:start_time] if params.key?(:start_time)
query_params["user_id"] = params[:user_id] if params.key?(:user_id)
params.except(*query_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "user-usage-detail",
query: query_params,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Schematic::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Schematic::Entitlements::Types::GetUserUsageDetailResponse.load(response.body)
else
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Schematic
module Entitlements
module Types
# Input parameters
class GetUserUsageByCompanyParams < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false
field :end_time, -> { String }, optional: true, nullable: false
field :feature_id, -> { String }, optional: true, nullable: false
field :start_time, -> { String }, optional: true, nullable: false
end
end
end
end
Loading