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": "19cafdf92ab056ef6ba803bf1e352b0422a8ec45",
"sdkVersion": "1.4.9"
"originGitCommit": "75191b40ce7af084ca4fb11f623ab59c57cf97e3",
"sdkVersion": "1.4.10"
}
346 changes: 344 additions & 2 deletions .fern/replay.lock

Large diffs are not rendered by default.

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

Expand All @@ -26,7 +26,7 @@ GEM
minitest-rg (5.4.0)
minitest (>= 5.0, < 7)
parallel (2.1.0)
parser (3.3.11.1)
parser (3.3.12.0)
ast (~> 2.4.1)
racc
prism (1.9.0)
Expand Down Expand Up @@ -56,7 +56,7 @@ GEM
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-minitest (0.39.1)
rubocop-minitest (0.40.0)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
Expand Down
129 changes: 91 additions & 38 deletions lib/schematic.rb

Large diffs are not rendered by default.

480 changes: 480 additions & 0 deletions lib/schematic/catalogs/client.rb

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions lib/schematic/catalogs/types/create_catalog_request_body.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Schematic
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
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/create_catalog_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class CreateCatalogResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/delete_catalog_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class DeleteCatalogResponse < Internal::Types::Model
field :data, -> { Schematic::Types::DeleteResponse }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/get_catalog_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class GetCatalogResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/get_configuration_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class GetConfigurationResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogConfigurationResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, 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 Catalogs
module Types
class GetCreditBundlesInCatalogResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogCreditBundleIDsResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/get_derived_features_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class GetDerivedFeaturesResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogDerivedFeaturesResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/get_plans_in_catalog_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class GetPlansInCatalogResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogPlanIDsResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
15 changes: 15 additions & 0 deletions lib/schematic/catalogs/types/list_catalogs_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
# Input parameters
class ListCatalogsParams < Internal::Types::Model
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 :q, -> { String }, optional: true, nullable: false
end
end
end
end
14 changes: 14 additions & 0 deletions lib/schematic/catalogs/types/list_catalogs_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class ListCatalogsRequest < Internal::Types::Model
field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :q, -> { String }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/list_catalogs_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class ListCatalogsResponse < Internal::Types::Model
field :data, -> { Internal::Types::Array[Schematic::Types::CatalogResponseData] }, optional: false, nullable: false
field :params, -> { Schematic::Catalogs::Types::ListCatalogsParams }, optional: false, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class UpdateCatalogConfigurationRequestBody < Internal::Types::Model
field :catalog_id, -> { String }, optional: false, nullable: false
field :custom_plan_cta_text, -> { String }, optional: true, nullable: false
field :custom_plan_cta_url, -> { String }, optional: true, nullable: false
field :custom_plan_price_text, -> { String }, optional: true, nullable: false
field :custom_plans_visible, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :ordered_add_ons, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan] }, optional: true, nullable: false
field :ordered_bundles, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedBundle] }, optional: true, nullable: false
field :ordered_plans, -> { Internal::Types::Array[Schematic::Types::CatalogConfigOrderedPlan] }, optional: true, nullable: false
field :pricing_model, -> { String }, optional: true, nullable: false
field :pricing_url, -> { String }, optional: true, nullable: false
end
end
end
end
14 changes: 14 additions & 0 deletions lib/schematic/catalogs/types/update_catalog_request_body.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class UpdateCatalogRequestBody < Internal::Types::Model
field :catalog_id, -> { String }, optional: false, nullable: false
field :description, -> { String }, optional: true, nullable: false
field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :name, -> { String }, optional: true, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/update_catalog_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class UpdateCatalogResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/catalogs/types/update_configuration_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Catalogs
module Types
class UpdateConfigurationResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CatalogResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
69 changes: 69 additions & 0 deletions lib/schematic/checkout/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,75 @@ def preview_checkout_internal(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] :company_id
#
# @return [Schematic::Checkout::Types::GetCompanyBillingDetailsResponse]
def get_company_billing_details(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/billing-details",
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::Checkout::Types::GetCompanyBillingDetailsResponse.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::Checkout::Types::UpdateCompanyBillingDetailsRequestBody]
# @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
#
# @return [Schematic::Checkout::Types::UpdateCompanyBillingDetailsResponse]
def update_company_billing_details(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request_data = Schematic::Checkout::Types::UpdateCompanyBillingDetailsRequestBody.new(params).to_h
non_body_param_names = ["company_id"]
body = request_data.except(*non_body_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "PUT",
path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/billing-details",
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::Checkout::Types::UpdateCompanyBillingDetailsResponse.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::Types::ManagePlanRequest]
# @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 Checkout
module Types
class GetCompanyBillingDetailsResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CompanyBillingDetailsResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
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 Checkout
module Types
class UpdateCompanyBillingDetailsRequestBody < Internal::Types::Model
field :company_id, -> { String }, optional: false, nullable: false
field :address, -> { Schematic::Types::CustomerBillingAddress }, optional: true, nullable: false
field :email, -> { String }, optional: true, nullable: false
field :phone, -> { String }, optional: true, nullable: false
field :values, -> { Internal::Types::Array[Schematic::Types::CheckoutFieldValue] }, optional: false, 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 Checkout
module Types
class UpdateCompanyBillingDetailsResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CompanyBillingDetailsResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
7 changes: 6 additions & 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.9",
"User-Agent" => "schematichq/1.4.10",
"X-Fern-Language" => "Ruby",
"X-Schematic-Api-Key" => api_key.to_s
}
Expand All @@ -32,6 +32,11 @@ def credits
@credits ||= Schematic::Credits::Client.new(client: @raw_client)
end

# @return [Schematic::Catalogs::Client]
def catalogs
@catalogs ||= Schematic::Catalogs::Client.new(client: @raw_client)
end

# @return [Schematic::Checkout::Client]
def checkout
@checkout ||= Schematic::Checkout::Client.new(client: @raw_client)
Expand Down
Loading