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": "75191b40ce7af084ca4fb11f623ab59c57cf97e3",
"sdkVersion": "1.4.10"
"originGitCommit": "340529eacf4f1dcc5522e771872c1dd94b9c4891",
"sdkVersion": "1.4.11"
}
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.

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

Expand Down
15 changes: 14 additions & 1 deletion lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
require_relative "schematic/internal/iterators/offset_item_iterator"
require_relative "schematic/internal/iterators/cursor_page_iterator"
require_relative "schematic/internal/iterators/offset_page_iterator"
require_relative "schematic/types/account_member_role"
require_relative "schematic/accounts/types/list_account_members_params"
require_relative "schematic/types/account_member_permission"
require_relative "schematic/types/account_member_role"
require_relative "schematic/types/account_member_response_data"
require_relative "schematic/accounts/types/list_account_members_response"
require_relative "schematic/accounts/types/get_account_member_response"
Expand Down Expand Up @@ -604,6 +604,12 @@
require_relative "schematic/integrationsapi/types/assume_stripe_installed_response"
require_relative "schematic/integrationsapi/types/install_stripe_response"
require_relative "schematic/integrationsapi/types/uninstall_integration_response"
require_relative "schematic/licenses/types/list_licenses_params"
require_relative "schematic/types/license_response_data"
require_relative "schematic/licenses/types/list_licenses_response"
require_relative "schematic/licenses/types/get_single_license_response"
require_relative "schematic/licenses/types/count_licenses_params"
require_relative "schematic/licenses/types/count_licenses_response"
require_relative "schematic/plangroups/types/get_plan_group_params"
require_relative "schematic/types/checkout_field_response_data"
require_relative "schematic/types/checkout_settings_response_data"
Expand Down Expand Up @@ -637,6 +643,9 @@
require_relative "schematic/planmigrations/types/retry_migration_response"
require_relative "schematic/planmigrations/types/count_migrations_params"
require_relative "schematic/planmigrations/types/count_migrations_response"
require_relative "schematic/types/plan_version_migration_preview_company_response_data"
require_relative "schematic/types/plan_version_migration_preview_response_data"
require_relative "schematic/planmigrations/types/preview_migration_response"
require_relative "schematic/types/plan_view_public_response_data"
require_relative "schematic/types/public_plans_response_data"
require_relative "schematic/componentspublic/types/get_public_plans_response"
Expand Down Expand Up @@ -954,6 +963,9 @@
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/licenses/client"
require_relative "schematic/licenses/types/list_licenses_request"
require_relative "schematic/licenses/types/count_licenses_request"
require_relative "schematic/plangroups/client"
require_relative "schematic/plangroups/types/get_plan_group_request"
require_relative "schematic/plangroups/types/create_plan_group_request_body"
Expand All @@ -965,6 +977,7 @@
require_relative "schematic/planmigrations/types/create_migration_input"
require_relative "schematic/planmigrations/types/retry_migration_request_body"
require_relative "schematic/planmigrations/types/count_migrations_request"
require_relative "schematic/planmigrations/types/preview_migration_request_body"
require_relative "schematic/componentspublic/client"
require_relative "schematic/scheduledcheckout/client"
require_relative "schematic/scheduledcheckout/types/list_scheduled_checkouts_request"
Expand Down
8 changes: 6 additions & 2 deletions lib/schematic/accounts/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ def initialize(client:)
# @option request_options [Integer] :timeout_in_seconds
# @option params [String, nil] :ids
# @option params [String, nil] :q
# @option params [Schematic::Types::AccountMemberRole, nil] :role
# @option params [Integer, nil] :limit
# @option params [Integer, nil] :offset
#
# @return [Schematic::Accounts::Types::ListAccountMembersResponse]
def list_account_members(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[ids q limit offset]
query_param_names = %i[ids q role limit offset]
query_params = {}
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["q"] = params[:q] if params.key?(:q)
query_params["role"] = params[:role] if params.key?(:role)
query_params["limit"] = params[:limit] if params.key?(:limit)
query_params["offset"] = params[:offset] if params.key?(:offset)
params.except(*query_param_names)
Expand Down Expand Up @@ -95,16 +97,18 @@ def get_account_member(request_options: {}, **params)
# @option request_options [Integer] :timeout_in_seconds
# @option params [String, nil] :ids
# @option params [String, nil] :q
# @option params [Schematic::Types::AccountMemberRole, nil] :role
# @option params [Integer, nil] :limit
# @option params [Integer, nil] :offset
#
# @return [Schematic::Accounts::Types::CountAccountMembersResponse]
def count_account_members(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[ids q limit offset]
query_param_names = %i[ids q role limit offset]
query_params = {}
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["q"] = params[:q] if params.key?(:q)
query_params["role"] = params[:role] if params.key?(:role)
query_params["limit"] = params[:limit] if params.key?(:limit)
query_params["offset"] = params[:offset] if params.key?(:offset)
params.except(*query_param_names)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class CountAccountMembersParams < Internal::Types::Model
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
field :q, -> { String }, optional: true, nullable: false
field :role, -> { Schematic::Types::AccountMemberRole }, optional: true, nullable: false
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Types
class CountAccountMembersRequest < Internal::Types::Model
field :ids, -> { String }, optional: true, nullable: false
field :q, -> { String }, optional: true, nullable: false
field :role, -> { Schematic::Types::AccountMemberRole }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ListAccountMembersParams < Internal::Types::Model
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
field :q, -> { String }, optional: true, nullable: false
field :role, -> { Schematic::Types::AccountMemberRole }, optional: true, nullable: false
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Types
class ListAccountMembersRequest < Internal::Types::Model
field :ids, -> { String }, optional: true, nullable: false
field :q, -> { String }, optional: true, nullable: false
field :role, -> { Schematic::Types::AccountMemberRole }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
end
Expand Down
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.10",
"User-Agent" => "schematichq/1.4.11",
"X-Fern-Language" => "Ruby",
"X-Schematic-Api-Key" => api_key.to_s
}
Expand Down Expand Up @@ -92,6 +92,11 @@ def integrationsapi
@integrationsapi ||= Schematic::Integrationsapi::Client.new(client: @raw_client)
end

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

# @return [Schematic::Plangroups::Client]
def plangroups
@plangroups ||= Schematic::Plangroups::Client.new(client: @raw_client)
Expand Down
138 changes: 138 additions & 0 deletions lib/schematic/licenses/client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# frozen_string_literal: true

module Schematic
module Licenses
class Client
# @param client [Schematic::Internal::Http::RawClient]
#
# @return [void]
def initialize(client:)
@client = client
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] :feature_ids
# @option params [String, nil] :ids
# @option params [String, nil] :name
# @option params [Integer, nil] :limit
# @option params [Integer, nil] :offset
#
# @return [Schematic::Licenses::Types::ListLicensesResponse]
def list_licenses(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[feature_ids ids name limit offset]
query_params = {}
query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids)
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["name"] = params[:name] if params.key?(:name)
query_params["limit"] = params[:limit] if params.key?(:limit)
query_params["offset"] = params[:offset] if params.key?(:offset)
params.except(*query_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "licenses",
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::Licenses::Types::ListLicensesResponse.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] :license_id
#
# @return [Schematic::Licenses::Types::GetSingleLicenseResponse]
def get_single_license(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: "licenses/#{URI.encode_uri_component(params[:license_id].to_s)}",
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::Licenses::Types::GetSingleLicenseResponse.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] :feature_ids
# @option params [String, nil] :ids
# @option params [String, nil] :name
# @option params [Integer, nil] :limit
# @option params [Integer, nil] :offset
#
# @return [Schematic::Licenses::Types::CountLicensesResponse]
def count_licenses(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[feature_ids ids name limit offset]
query_params = {}
query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids)
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["name"] = params[:name] if params.key?(:name)
query_params["limit"] = params[:limit] if params.key?(:limit)
query_params["offset"] = params[:offset] if params.key?(:offset)
params.except(*query_param_names)

request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "licenses/count",
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::Licenses::Types::CountLicensesResponse.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
16 changes: 16 additions & 0 deletions lib/schematic/licenses/types/count_licenses_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

module Schematic
module Licenses
module Types
# Input parameters
class CountLicensesParams < Internal::Types::Model
field :feature_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :name, -> { String }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
end
end
end
end
15 changes: 15 additions & 0 deletions lib/schematic/licenses/types/count_licenses_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Schematic
module Licenses
module Types
class CountLicensesRequest < Internal::Types::Model
field :feature_ids, -> { String }, optional: true, nullable: false
field :ids, -> { String }, optional: true, nullable: false
field :name, -> { 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/licenses/types/count_licenses_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Licenses
module Types
class CountLicensesResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CountResponse }, optional: false, nullable: false
field :params, -> { Schematic::Licenses::Types::CountLicensesParams }, optional: false, nullable: false
end
end
end
end
12 changes: 12 additions & 0 deletions lib/schematic/licenses/types/get_single_license_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Licenses
module Types
class GetSingleLicenseResponse < Internal::Types::Model
field :data, -> { Schematic::Types::LicenseResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
end
end
Loading