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
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "5.50.0",
"generatorName": "fernapi/fern-ruby-sdk",
"generatorVersion": "1.23.2",
"generatorVersion": "1.24.0",
"generatorConfig": {
"module": "SchematicHQ",
"rubocopVariableNumberStyle": "disabled",
Expand All @@ -13,10 +13,10 @@
"webrick": ">= 1.0"
}
},
"originGitCommit": "686551a0297d2f37075b3586b030ff32be5c94f7",
"originGitCommit": "31f498c0a9babdc0eec5ae88e1212a254b2f2561",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "1.4.16",
"requestedVersion": "1.4.17",
"ciProvider": "github",
"sdkVersion": "1.4.16"
"sdkVersion": "1.4.17"
}
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.

44 changes: 41 additions & 3 deletions lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@
require_relative "schematic/billing/types/list_billing_products_response"
require_relative "schematic/billing/types/count_billing_products_params"
require_relative "schematic/billing/types/count_billing_products_response"
require_relative "schematic/billing/types/list_company_billing_profiles_params"
require_relative "schematic/types/billing_collection_method"
require_relative "schematic/types/proration_behavior"
require_relative "schematic/types/company_billing_profile_response_data"
require_relative "schematic/billing/types/list_company_billing_profiles_response"
require_relative "schematic/billing/types/update_company_billing_profile_response"
require_relative "schematic/types/billing_subscription_trial_end_setting"
require_relative "schematic/types/billing_subscription_response_data"
require_relative "schematic/billing/types/upsert_billing_subscription_response"
Expand Down Expand Up @@ -210,6 +216,16 @@
require_relative "schematic/credits/types/delete_billing_plan_credit_grant_response"
require_relative "schematic/credits/types/count_billing_plan_credit_grants_params"
require_relative "schematic/credits/types/count_billing_plan_credit_grants_response"
require_relative "schematic/types/credit_spend_policy_scope"
require_relative "schematic/credits/types/list_credit_spend_policies_params"
require_relative "schematic/types/credit_spend_policy_response_data"
require_relative "schematic/credits/types/list_credit_spend_policies_response"
require_relative "schematic/credits/types/create_credit_spend_policy_response"
require_relative "schematic/credits/types/get_credit_spend_policy_response"
require_relative "schematic/credits/types/update_credit_spend_policy_response"
require_relative "schematic/credits/types/delete_credit_spend_policy_response"
require_relative "schematic/credits/types/count_credit_spend_policies_params"
require_relative "schematic/credits/types/count_credit_spend_policies_response"
require_relative "schematic/types/credit_event_type"
require_relative "schematic/credits/types/list_credit_event_ledger_params"
require_relative "schematic/types/billing_credit_ledger_response_data"
Expand Down Expand Up @@ -249,6 +265,8 @@
require_relative "schematic/types/flag_type"
require_relative "schematic/types/metric_period"
require_relative "schematic/types/metric_period_month_reset"
require_relative "schematic/types/plan_version_status"
require_relative "schematic/types/rule_condition_plan_version_response_data"
require_relative "schematic/types/rule_condition_detail_response_data"
require_relative "schematic/types/rule_condition_group_detail_response_data"
require_relative "schematic/types/rule_type"
Expand All @@ -264,7 +282,6 @@
require_relative "schematic/types/warning_tier_response_data"
require_relative "schematic/types/plan_entitlement_response_data"
require_relative "schematic/types/plan_price_cadence"
require_relative "schematic/types/plan_version_status"
require_relative "schematic/types/plan_version_response_data"
require_relative "schematic/types/plan_group_plan_detail_response_data"
require_relative "schematic/types/catalog_configuration_response_data"
Expand Down Expand Up @@ -532,7 +549,6 @@
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 @@ -572,6 +588,10 @@
require_relative "schematic/events/types/list_events_response"
require_relative "schematic/events/types/create_event_response"
require_relative "schematic/events/types/get_event_response"
require_relative "schematic/types/otlp_environment_settings_response_data"
require_relative "schematic/events/types/get_otlp_environment_settings_response"
require_relative "schematic/events/types/upsert_otlp_environment_settings_response"
require_relative "schematic/events/types/delete_otlp_environment_settings_response"
require_relative "schematic/types/segment_status_resp"
require_relative "schematic/events/types/get_segment_integration_status_response"
require_relative "schematic/features/types/list_features_params"
Expand Down Expand Up @@ -645,8 +665,18 @@
require_relative "schematic/integrationsapi/types/start_data_import_response"
require_relative "schematic/types/integrations_data_set_response_data"
require_relative "schematic/integrationsapi/types/load_sample_data_set_response"
require_relative "schematic/types/stripe_sandbox_claim_link"
require_relative "schematic/integrationsapi/types/get_stripe_sandbox_claim_link_response"
require_relative "schematic/types/claimed_stripe_sandbox_keys_response_data"
require_relative "schematic/integrationsapi/types/get_stripe_sandbox_keys_response"
require_relative "schematic/integrationsapi/types/claim_stripe_sandbox_keys_response"
require_relative "schematic/integrationsapi/types/assume_stripe_installed_response"
require_relative "schematic/integrationsapi/types/install_stripe_response"
require_relative "schematic/types/stripe_sandbox_keys_response_data"
require_relative "schematic/types/stripe_sandbox_install_response_data"
require_relative "schematic/integrationsapi/types/install_stripe_claimable_sandbox_response"
require_relative "schematic/types/stripe_sandbox_countries_response_data"
require_relative "schematic/integrationsapi/types/list_stripe_sandbox_countries_response"
require_relative "schematic/integrationsapi/types/uninstall_integration_response"
require_relative "schematic/licenses/types/list_licenses_params"
require_relative "schematic/types/license_response_data"
Expand Down Expand Up @@ -729,7 +759,6 @@
require_relative "schematic/webhooks/types/count_webhooks_params"
require_relative "schematic/webhooks/types/count_webhooks_response"
require_relative "schematic/types/api_error"
require_relative "schematic/types/billing_collection_method"
require_relative "schematic/types/billing_product_pricing"
require_relative "schematic/types/billing_subscription_discount"
require_relative "schematic/types/capture_raw_event"
Expand Down Expand Up @@ -887,6 +916,8 @@
require_relative "schematic/billing/types/create_billing_product_request_body"
require_relative "schematic/billing/types/list_billing_products_request"
require_relative "schematic/billing/types/count_billing_products_request"
require_relative "schematic/billing/types/list_company_billing_profiles_request"
require_relative "schematic/billing/types/update_company_billing_profile_request_body"
require_relative "schematic/billing/types/create_billing_subscription_request_body"
require_relative "schematic/credits/client"
require_relative "schematic/credits/types/list_billing_credits_request"
Expand All @@ -909,6 +940,10 @@
require_relative "schematic/credits/types/list_billing_plan_credit_grants_request"
require_relative "schematic/credits/types/delete_billing_plan_credit_grant_request"
require_relative "schematic/credits/types/count_billing_plan_credit_grants_request"
require_relative "schematic/credits/types/list_credit_spend_policies_request"
require_relative "schematic/credits/types/create_credit_spend_policy_request_body"
require_relative "schematic/credits/types/update_credit_spend_policy_request_body"
require_relative "schematic/credits/types/count_credit_spend_policies_request"
require_relative "schematic/credits/types/list_credit_event_ledger_request"
require_relative "schematic/credits/types/count_credit_event_ledger_request"
require_relative "schematic/catalogs/client"
Expand Down Expand Up @@ -1001,6 +1036,7 @@
require_relative "schematic/events/types/create_event_batch_request_body"
require_relative "schematic/events/types/get_event_summaries_request"
require_relative "schematic/events/types/list_events_request"
require_relative "schematic/events/types/upsert_otlp_environment_settings_request_body"
require_relative "schematic/features/client"
require_relative "schematic/features/types/list_features_request"
require_relative "schematic/features/types/create_feature_request_body"
Expand All @@ -1020,6 +1056,8 @@
require_relative "schematic/integrationsapi/client"
require_relative "schematic/integrationsapi/types/list_integrations_request"
require_relative "schematic/integrationsapi/types/start_data_import_request_body"
require_relative "schematic/integrationsapi/types/claim_stripe_sandbox_keys_request_body"
require_relative "schematic/integrationsapi/types/install_stripe_sandbox_request_body"
require_relative "schematic/licenses/client"
require_relative "schematic/licenses/types/list_licenses_request"
require_relative "schematic/licenses/types/count_licenses_request"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Schematic
module Accounts
module Types
class UpdateOnboardingStateRequestBody < Internal::Types::Model
field :country, -> { String }, optional: true, nullable: false

field :dismissed, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :path, -> { Schematic::Types::OnboardingPath }, optional: true, nullable: false
Expand Down
96 changes: 96 additions & 0 deletions lib/schematic/billing/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,102 @@ def count_billing_products(request_options: {}, **params)
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, nil] :company_id
# @option params [Boolean, nil] :is_default
# @option params [Schematic::Types::BillingProviderType, nil] :provider_type
# @option params [Integer, nil] :limit
# @option params [Integer, nil] :offset
#
# @example
# client.billing.list_company_billing_profiles(
# company_id: "company_id",
# is_default: true,
# provider_type: "metronome",
# limit: 1000000,
# offset: 1000000
# )
#
# @return [Schematic::Billing::Types::ListCompanyBillingProfilesResponse]
def list_company_billing_profiles(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_params = {}
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
query_params["is_default"] = params[:is_default] if params.key?(:is_default)
query_params["provider_type"] = params[:provider_type] if params.key?(:provider_type)
query_params["limit"] = params[:limit] if params.key?(:limit)
query_params["offset"] = params[:offset] if params.key?(:offset)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "billing/profiles",
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::Billing::Types::ListCompanyBillingProfilesResponse.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 [Schematic::Billing::Types::UpdateCompanyBillingProfileRequestBody]
# @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] :billing_profile_id
#
# @example
# client.billing.update_company_billing_profile(
# billing_profile_id: "billing_profile_id",
# collection_method: "charge_automatically"
# )
#
# @return [Schematic::Billing::Types::UpdateCompanyBillingProfileResponse]
def update_company_billing_profile(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request_data = Schematic::Billing::Types::UpdateCompanyBillingProfileRequestBody.new(params).to_h
non_body_param_names = %w[billing_profile_id]
body = request_data.except(*non_body_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "PUT",
path: "billing/profiles/#{URI.encode_uri_component(params[:billing_profile_id].to_s)}",
body: body,
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::Billing::Types::UpdateCompanyBillingProfileResponse.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 [Schematic::Billing::Types::CreateBillingSubscriptionRequestBody]
# @option request_options [String] :base_url
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Schematic
module Billing
module Types
# Input parameters
class ListCompanyBillingProfilesParams < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false

field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :limit, -> { Integer }, optional: true, nullable: false

field :offset, -> { Integer }, optional: true, nullable: false

field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

module Schematic
module Billing
module Types
class ListCompanyBillingProfilesRequest < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false

field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false

field :limit, -> { Integer }, optional: true, nullable: false

field :offset, -> { Integer }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
module Billing
module Types
class ListCompanyBillingProfilesResponse < Internal::Types::Model
field :data, -> { Internal::Types::Array[Schematic::Types::CompanyBillingProfileResponseData] }, optional: false, nullable: false

field :params, -> { Schematic::Billing::Types::ListCompanyBillingProfilesParams }, optional: false, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module Schematic
module Billing
module Types
class UpdateCompanyBillingProfileRequestBody < Internal::Types::Model
field :billing_profile_id, -> { String }, optional: false, nullable: false

field :collection_method, -> { Schematic::Types::BillingCollectionMethod }, optional: false, nullable: false

field :days_until_due, -> { Integer }, optional: true, nullable: false

field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :name, -> { String }, optional: true, nullable: false

field :payment_method_id, -> { String }, optional: true, nullable: false

field :proration_behavior, -> { Schematic::Types::ProrationBehavior }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
module Billing
module Types
class UpdateCompanyBillingProfileResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CompanyBillingProfileResponseData }, optional: false, nullable: false

field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
2 changes: 1 addition & 1 deletion lib/schematic/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def initialize(api_key:, base_url: nil, max_retries: 2)
@raw_client = Schematic::Internal::Http::RawClient.new(
base_url: base_url || Schematic::Environment::DEFAULT,
headers: {
"User-Agent" => "schematichq/1.4.16",
"User-Agent" => "schematichq/1.4.17",
"X-Fern-Language" => "Ruby",
"X-Schematic-Api-Key" => api_key.to_s
},
Expand Down
Loading