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": "deb8532a1f84f6daa08b5c611a66a5ec92f53f0e",
"sdkVersion": "1.4.7"
"originGitCommit": "1c3370c354acf100ad68319d09b964e93635a3d5",
"sdkVersion": "1.4.8"
}
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
schematichq (1.4.7)
schematichq (1.4.8)
wasmtime (>= 19.0)
websocket (>= 1.2)

Expand All @@ -19,7 +19,7 @@ GEM
hashdiff (1.2.1)
io-console (0.8.2)
json (2.20.0)
language_server-protocol (3.17.0.5)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
method_source (1.1.0)
minitest (5.27.0)
Expand All @@ -42,7 +42,7 @@ GEM
reline (0.6.3)
io-console (~> 0.5)
rexml (3.4.4)
rubocop (1.88.0)
rubocop (1.88.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
Expand All @@ -53,7 +53,7 @@ GEM
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-minitest (0.39.1)
Expand Down
9 changes: 9 additions & 0 deletions lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
require_relative "schematic/credits/types/extend_credit_lease_response"
require_relative "schematic/credits/types/release_credit_lease_response"
require_relative "schematic/credits/types/list_billing_plan_credit_grants_params"
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/preview_object_response_data"
Expand Down Expand Up @@ -304,6 +305,12 @@
require_relative "schematic/companies/types/delete_company_by_keys_response"
require_relative "schematic/companies/types/lookup_company_params"
require_relative "schematic/companies/types/lookup_company_response"
require_relative "schematic/companies/types/get_company_billing_entity_params"
require_relative "schematic/types/company_billing_entity_response_data"
require_relative "schematic/companies/types/get_company_billing_entity_response"
require_relative "schematic/companies/types/get_billing_entity_child_subscriptions_params"
require_relative "schematic/types/company_billing_entity_subscription_response_data"
require_relative "schematic/companies/types/get_billing_entity_child_subscriptions_response"
require_relative "schematic/companies/types/list_company_memberships_params"
require_relative "schematic/types/company_membership_detail_response_data"
require_relative "schematic/companies/types/list_company_memberships_response"
Expand Down Expand Up @@ -804,6 +811,8 @@
require_relative "schematic/companies/types/delete_company_request"
require_relative "schematic/companies/types/count_companies_request"
require_relative "schematic/companies/types/lookup_company_request"
require_relative "schematic/companies/types/get_company_billing_entity_request"
require_relative "schematic/companies/types/get_billing_entity_child_subscriptions_request"
require_relative "schematic/companies/types/list_company_memberships_request"
require_relative "schematic/companies/types/get_or_create_company_membership_request_body"
require_relative "schematic/companies/types/get_active_company_subscription_request"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class CreateBillingSubscriptionRequestBody < Internal::Types::Model
field :application_id, -> { String }, optional: true, nullable: false
field :cancel_at, -> { Integer }, optional: true, nullable: false
field :cancel_at_period_end, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :company_id, -> { String }, optional: true, nullable: false
field :currency, -> { String }, optional: false, nullable: false
field :customer_external_id, -> { String }, optional: false, nullable: false
field :default_payment_method_external_id, -> { String }, optional: true, nullable: false
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.7",
"User-Agent" => "schematichq/1.4.8",
"X-Fern-Language" => "Ruby",
"X-Schematic-Api-Key" => api_key.to_s
}
Expand Down
76 changes: 76 additions & 0 deletions lib/schematic/companies/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,82 @@ def lookup_company(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
#
# @return [Schematic::Companies::Types::GetCompanyBillingEntityResponse]
def get_company_billing_entity(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[company_id]
query_params = {}
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
params.except(*query_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "company-billing-entity",
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::Companies::Types::GetCompanyBillingEntityResponse.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, nil] :company_id
#
# @return [Schematic::Companies::Types::GetBillingEntityChildSubscriptionsResponse]
def get_billing_entity_child_subscriptions(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[company_id]
query_params = {}
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
params.except(*query_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "company-billing-entity-subscriptions",
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::Companies::Types::GetBillingEntityChildSubscriptionsResponse.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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
# Input parameters
class GetBillingEntityChildSubscriptionsParams < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
class GetBillingEntityChildSubscriptionsRequest < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
class GetBillingEntityChildSubscriptionsResponse < Internal::Types::Model
field :data, -> { Internal::Types::Array[Schematic::Types::CompanyBillingEntitySubscriptionResponseData] }, optional: false, nullable: false
field :params, -> { Schematic::Companies::Types::GetBillingEntityChildSubscriptionsParams }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/companies/types/get_company_billing_entity_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
# Input parameters
class GetCompanyBillingEntityParams < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
class GetCompanyBillingEntityRequest < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
class GetCompanyBillingEntityResponse < Internal::Types::Model
field :data, -> { Internal::Types::Array[Schematic::Types::CompanyBillingEntityResponseData] }, optional: false, nullable: false
field :params, -> { Schematic::Companies::Types::GetCompanyBillingEntityParams }, optional: false, nullable: false
end
end
end
end
13 changes: 13 additions & 0 deletions lib/schematic/types/billing_credit_auto_topup_availability.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
module Types
module BillingCreditAutoTopupAvailability
extend Schematic::Internal::Types::Enum

OFF = "off"
AUTOMATIC = "automatic"
USER_CONTROLLED = "user_controlled"
end
end
end
2 changes: 2 additions & 0 deletions lib/schematic/types/billing_credit_grant_zeroed_out_reason.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ module Types
module BillingCreditGrantZeroedOutReason
extend Schematic::Internal::Types::Enum

CUSTOMER_ARCHIVED = "customer_archived"
EXPIRED = "expired"
INTEGRATION_UNINSTALLED = "integration_uninstalled"
MANUAL = "manual"
PLAN_CHANGE = "plan_change"
PLAN_PERIOD_RESET = "plan_period_reset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ module Types
class BillingPlanCreditGrantResponseData < Internal::Types::Model
field :auto_topup_amount, -> { Integer }, optional: true, nullable: false
field :auto_topup_amount_type, -> { String }, optional: true, nullable: false
field :auto_topup_availability, -> { Schematic::Types::BillingCreditAutoTopupAvailability }, optional: false, nullable: false
field :auto_topup_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :auto_topup_expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: true, nullable: false
field :auto_topup_expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: true, nullable: false
field :auto_topup_expiry_unit_count, -> { Integer }, optional: true, nullable: false
field :auto_topup_self_service, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :auto_topup_threshold_credits, -> { Integer }, optional: true, nullable: false
field :auto_topup_threshold_percent, -> { Integer }, optional: true, nullable: false
field :can_buy_bundles, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :created_at, -> { String }, optional: false, nullable: false
field :credit, -> { Schematic::Types::BillingCreditResponseData }, optional: true, nullable: false
field :credit_amount, -> { Integer }, optional: false, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Types
class ChangeSubscriptionInternalRequestBody < Internal::Types::Model
field :add_on_ids, -> { Internal::Types::Array[Schematic::Types::UpdateAddOnRequestBody] }, optional: false, nullable: false
field :auto_topup_overrides, -> { Internal::Types::Array[Schematic::Types::UpdateAutoTopupOverrideRequestBody] }, optional: false, nullable: false
field :billing_entity_id, -> { String }, optional: true, nullable: false
field :company_id, -> { String }, optional: false, nullable: false
field :coupon_external_id, -> { String }, optional: true, nullable: false
field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::UpdateCreditBundleRequestBody] }, optional: false, nullable: false
Expand Down
1 change: 1 addition & 0 deletions lib/schematic/types/change_subscription_request_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Types
class ChangeSubscriptionRequestBody < Internal::Types::Model
field :add_on_ids, -> { Internal::Types::Array[Schematic::Types::UpdateAddOnRequestBody] }, optional: false, nullable: false
field :auto_topup_overrides, -> { Internal::Types::Array[Schematic::Types::UpdateAutoTopupOverrideRequestBody] }, optional: false, nullable: false
field :billing_entity_id, -> { String }, optional: true, nullable: false
field :coupon_external_id, -> { String }, optional: true, nullable: false
field :credit_bundles, -> { Internal::Types::Array[Schematic::Types::UpdateCreditBundleRequestBody] }, optional: false, nullable: false
field :custom_field_values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, nullable: false
Expand Down
10 changes: 10 additions & 0 deletions lib/schematic/types/company_billing_entity_response_data.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

module Schematic
module Types
class CompanyBillingEntityResponseData < Internal::Types::Model
field :billing_entity, -> { Schematic::Types::CompanyResponseData }, optional: true, nullable: false
field :has_own_stripe_customer, -> { Internal::Types::Boolean }, optional: false, nullable: false
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

module Schematic
module Types
class CompanyBillingEntitySubscriptionResponseData < Internal::Types::Model
field :cancel_at, -> { String }, optional: true, nullable: false
field :cancel_at_period_end, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :company, -> { Schematic::Types::CompanyResponseData }, optional: true, nullable: false
field :currency, -> { String }, optional: false, nullable: false
field :customer_external_id, -> { String }, optional: false, nullable: false
field :discounts, -> { Internal::Types::Array[Schematic::Types::BillingSubscriptionDiscountView] }, optional: false, nullable: false
field :expired_at, -> { String }, optional: true, nullable: false
field :interval, -> { String }, optional: false, nullable: false
field :is_initial, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :latest_invoice, -> { Schematic::Types::InvoiceResponseData }, optional: true, nullable: false
field :payment_method, -> { Schematic::Types::PaymentMethodResponseData }, optional: true, nullable: false
field :plan_name, -> { String }, optional: false, nullable: false
field :products, -> { Internal::Types::Array[Schematic::Types::BillingProductForSubscriptionResponseData] }, optional: false, nullable: false
field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
field :status, -> { String }, optional: false, nullable: false
field :subscription_external_id, -> { String }, optional: false, nullable: false
field :total_price, -> { Integer }, optional: false, nullable: false
field :trial_end, -> { String }, optional: true, nullable: false
end
end
end
2 changes: 2 additions & 0 deletions lib/schematic/types/company_plan_credit_grant_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ module Types
class CompanyPlanCreditGrantView < Internal::Types::Model
field :billing_credit_auto_topup_amount, -> { Integer }, optional: true, nullable: false
field :billing_credit_auto_topup_amount_type, -> { String }, optional: true, nullable: false
field :billing_credit_auto_topup_availability, -> { Schematic::Types::BillingCreditAutoTopupAvailability }, optional: true, nullable: false
field :billing_credit_auto_topup_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :billing_credit_auto_topup_expiry_type, -> { Schematic::Types::BillingCreditExpiryType }, optional: true, nullable: false
field :billing_credit_auto_topup_expiry_unit, -> { Schematic::Types::BillingCreditExpiryUnit }, optional: true, nullable: false
field :billing_credit_auto_topup_expiry_unit_count, -> { Integer }, optional: true, nullable: false
field :billing_credit_auto_topup_self_service, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :billing_credit_auto_topup_threshold_credits, -> { Integer }, optional: true, nullable: false
field :billing_credit_auto_topup_threshold_percent, -> { Integer }, optional: true, nullable: false
field :billing_credit_can_buy_bundles, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :company_auto_topup_amount, -> { Integer }, optional: true, nullable: false
field :company_auto_topup_enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :company_auto_topup_threshold_credits, -> { Integer }, optional: true, nullable: false
Expand Down
2 changes: 2 additions & 0 deletions lib/schematic/types/company_plan_detail_response_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ class CompanyPlanDetailResponseData < Internal::Types::Model
field :company_can_trial, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :company_count, -> { Integer }, optional: false, nullable: false
field :company_id, -> { String }, optional: true, nullable: false
field :company_logo_url, -> { String }, optional: true, nullable: false
field :company_name, -> { String }, optional: true, nullable: false
field :compatible_plan_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
field :controlled_by, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
field :copied_from_plan_id, -> { String }, optional: true, nullable: false
field :created_at, -> { String }, optional: false, nullable: false
field :credits, -> { Internal::Types::Array[Schematic::Types::BillingCreditResponseData] }, optional: false, nullable: false
field :currency_prices, -> { Internal::Types::Array[Schematic::Types::PlanCurrencyPricesResponseData] }, optional: false, nullable: false
field :current, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :custom, -> { Internal::Types::Boolean }, optional: false, nullable: false
Expand Down
Loading