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
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "4.43.1",
"cliVersion": "4.76.1",
"generatorName": "fernapi/fern-ruby-sdk",
"generatorVersion": "1.1.11",
"generatorVersion": "1.1.13",
"generatorConfig": {
"module": "SchematicHQ",
"rubocopVariableNumberStyle": "disabled",
Expand All @@ -13,6 +13,6 @@
"webrick": ">= 1.0"
}
},
"originGitCommit": "42e108eda47d554722530a9d404ee80ba2da1b28",
"originGitCommit": "5315b1ba06c9c71f00ac501c3e7ea3092701cd7b",
"sdkVersion": "1.4.0"
}
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ PATH
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.9)
addressable (2.9.0)
public_suffix (>= 2.0.2, < 8.0)
ast (2.4.3)
bigdecimal (4.1.0)
bigdecimal (4.1.2)
coderay (1.1.3)
crack (1.0.1)
bigdecimal
rexml
hashdiff (1.2.1)
io-console (0.8.2)
json (2.19.3)
json (2.19.4)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
method_source (1.1.0)
minitest (5.27.0)
minitest-rg (5.4.0)
minitest (>= 5.0, < 7)
parallel (1.28.0)
parallel (2.0.1)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
Expand All @@ -37,16 +37,16 @@ GEM
public_suffix (7.0.5)
racc (1.8.1)
rainbow (3.1.1)
rake (13.3.1)
regexp_parser (2.11.3)
rake (13.4.2)
regexp_parser (2.12.0)
reline (0.6.3)
io-console (~> 0.5)
rexml (3.4.4)
rubocop (1.86.0)
rubocop (1.86.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
Expand All @@ -64,12 +64,12 @@ GEM
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
wasmtime (43.0.0-aarch64-linux)
wasmtime (43.0.0-aarch64-linux-musl)
wasmtime (43.0.0-arm64-darwin)
wasmtime (43.0.0-x86_64-darwin)
wasmtime (43.0.0-x86_64-linux)
wasmtime (43.0.0-x86_64-linux-musl)
wasmtime (43.0.1-aarch64-linux)
wasmtime (43.0.1-aarch64-linux-musl)
wasmtime (43.0.1-arm64-darwin)
wasmtime (43.0.1-x86_64-darwin)
wasmtime (43.0.1-x86_64-linux)
wasmtime (43.0.1-x86_64-linux-musl)
webmock (3.26.2)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down
101 changes: 53 additions & 48 deletions lib/schematic.rb

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions lib/schematic/accounts/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,82 @@ 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] :ids
# @option params [String, nil] :q
# @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_params = {}
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["q"] = params[:q] if params.key?(:q)
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: "account-members",
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::Accounts::Types::ListAccountMembersResponse.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] :account_member_id
#
# @return [Schematic::Accounts::Types::GetAccountMemberResponse]
def get_account_member(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: "account-members/#{URI.encode_uri_component(params[:account_member_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::Accounts::Types::GetAccountMemberResponse.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
@@ -1,10 +1,10 @@
# frozen_string_literal: true

module Schematic
module Companies
module Accounts
module Types
class CreatePlanTraitResponse < Internal::Types::Model
field :data, -> { Schematic::Types::PlanTraitResponseData }, optional: false, nullable: false
class GetAccountMemberResponse < Internal::Types::Model
field :data, -> { Schematic::Types::AccountMemberResponseData }, optional: false, nullable: false
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
end
end
Expand Down
15 changes: 15 additions & 0 deletions lib/schematic/accounts/types/list_account_members_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Schematic
module Accounts
module Types
# Input parameters
class ListAccountMembersParams < Internal::Types::Model
field :ids, -> { Internal::Types::Array[String] }, 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/accounts/types/list_account_members_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Schematic
module Accounts
module Types
class ListAccountMembersRequest < Internal::Types::Model
field :ids, -> { String }, 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/accounts/types/list_account_members_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Accounts
module Types
class ListAccountMembersResponse < Internal::Types::Model
field :data, -> { Internal::Types::Array[Schematic::Types::AccountMemberResponseData] }, optional: false, nullable: false
field :params, -> { Schematic::Accounts::Types::ListAccountMembersParams }, optional: false, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CreateBillingPriceRequestBody < Internal::Types::Model
field :interval, -> { String }, optional: false, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :meter_id, -> { String }, optional: true, nullable: false
field :nickname, -> { String }, optional: true, nullable: false
field :package_size, -> { Integer }, optional: true, nullable: false
field :price, -> { Integer }, optional: false, nullable: false
field :price_decimal, -> { String }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CreateBillingSubscriptionRequestBody < Internal::Types::Model
field :period_end, -> { Integer }, optional: true, nullable: false
field :period_start, -> { Integer }, optional: true, nullable: false
field :product_external_ids, -> { Internal::Types::Array[Schematic::Types::BillingProductPricing] }, optional: false, nullable: false
field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
field :status, -> { String }, optional: true, nullable: false
field :subscription_external_id, -> { String }, optional: false, nullable: false
field :total_price, -> { Integer }, optional: false, nullable: false
Expand Down
1 change: 1 addition & 0 deletions lib/schematic/billing/types/create_meter_request_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class CreateMeterRequestBody < Internal::Types::Model
field :event_name, -> { String }, optional: false, nullable: false
field :event_payload_key, -> { String }, optional: false, nullable: false
field :external_id, -> { String }, optional: false, nullable: false
field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
end
end
end
Expand Down
5 changes: 5 additions & 0 deletions lib/schematic/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def features
@features ||= Schematic::Features::Client.new(client: @raw_client)
end

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

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