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": "a9fc73b97dcfa602bff97a7d41d980a55c9c9030",
"sdkVersion": "1.4.12"
"originGitCommit": "8cfe954dda14329fc30a4f80b915db0acf608382",
"sdkVersion": "1.4.13"
}
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.

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

Expand All @@ -17,7 +17,7 @@ GEM
bigdecimal
rexml
hashdiff (1.2.1)
io-console (0.8.2)
io-console (0.9.2)
json (2.21.2)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
Expand All @@ -39,10 +39,10 @@ GEM
rainbow (3.1.1)
rake (13.4.2)
regexp_parser (2.12.0)
reline (0.6.3)
reline (0.7.0)
io-console (~> 0.5)
rexml (3.4.4)
rubocop (1.88.2)
rubocop (1.89.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
Expand All @@ -64,12 +64,12 @@ GEM
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
wasmtime (46.0.0-aarch64-linux)
wasmtime (46.0.0-aarch64-linux-musl)
wasmtime (46.0.0-arm64-darwin)
wasmtime (46.0.0-x86_64-darwin)
wasmtime (46.0.0-x86_64-linux)
wasmtime (46.0.0-x86_64-linux-musl)
wasmtime (47.0.3-aarch64-linux)
wasmtime (47.0.3-aarch64-linux-musl)
wasmtime (47.0.3-arm64-darwin)
wasmtime (47.0.3-x86_64-darwin)
wasmtime (47.0.3-x86_64-linux)
wasmtime (47.0.3-x86_64-linux-musl)
webmock (3.26.2)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down
9 changes: 9 additions & 0 deletions lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
require_relative "schematic/types/checkout_subscription"
require_relative "schematic/checkout/types/checkout_internal_response"
require_relative "schematic/types/billing_credit_ledger_authority"
require_relative "schematic/types/billing_product_record_response_data"
require_relative "schematic/types/credit_currency_price"
require_relative "schematic/types/billing_credit_view"
require_relative "schematic/types/billing_product_for_subscription_response_data"
Expand Down Expand Up @@ -355,8 +356,11 @@
require_relative "schematic/companies/types/upsert_company_trait_response"
require_relative "schematic/companies/types/list_entity_key_definitions_params"
require_relative "schematic/companies/types/list_entity_key_definitions_response"
require_relative "schematic/companies/types/delete_entity_key_definition_response"
require_relative "schematic/companies/types/count_entity_key_definitions_params"
require_relative "schematic/companies/types/count_entity_key_definitions_response"
require_relative "schematic/companies/types/count_entity_keys_params"
require_relative "schematic/companies/types/count_entity_keys_response"
require_relative "schematic/companies/types/list_entity_trait_definitions_params"
require_relative "schematic/companies/types/list_entity_trait_definitions_response"
require_relative "schematic/companies/types/get_or_create_entity_trait_definition_response"
Expand Down Expand Up @@ -521,7 +525,11 @@
require_relative "schematic/types/data_export_type"
require_relative "schematic/dataexports/types/list_data_exports_params"
require_relative "schematic/types/audit_log_export_metadata"
require_relative "schematic/types/company_feature_usage_export_metadata_sort_order_direction"
require_relative "schematic/types/company_feature_usage_export_metadata_visible_columns_item"
require_relative "schematic/types/company_feature_usage_export_metadata"
require_relative "schematic/types/event_export_metadata_event_types_item"
require_relative "schematic/types/event_export_metadata"
require_relative "schematic/types/data_export_metadata"
require_relative "schematic/types/data_export_output_file_type"
require_relative "schematic/types/data_export_response_data"
Expand Down Expand Up @@ -895,6 +903,7 @@
require_relative "schematic/companies/types/get_active_company_subscription_request"
require_relative "schematic/companies/types/list_entity_key_definitions_request"
require_relative "schematic/companies/types/count_entity_key_definitions_request"
require_relative "schematic/companies/types/count_entity_keys_request"
require_relative "schematic/companies/types/list_entity_trait_definitions_request"
require_relative "schematic/companies/types/create_entity_trait_definition_request_body"
require_relative "schematic/companies/types/update_entity_trait_definition_request_body"
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.12",
"User-Agent" => "schematichq/1.4.13",
"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 @@ -681,6 +681,38 @@ def list_entity_key_definitions(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] :entity_key_definition_id
#
# @return [Schematic::Companies::Types::DeleteEntityKeyDefinitionResponse]
def delete_entity_key_definition(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
request = Schematic::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "DELETE",
path: "entity-key-definitions/#{URI.encode_uri_component(params[:entity_key_definition_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::Companies::Types::DeleteEntityKeyDefinitionResponse.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 Expand Up @@ -727,6 +759,50 @@ def count_entity_key_definitions(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] :definition_id
# @option params [Schematic::Types::EntityType, nil] :entity_type
# @option params [Integer, nil] :limit
# @option params [Integer, nil] :offset
#
# @return [Schematic::Companies::Types::CountEntityKeysResponse]
def count_entity_keys(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[definition_id entity_type limit offset]
query_params = {}
query_params["definition_id"] = params[:definition_id] if params.key?(:definition_id)
query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type)
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: "entity-keys/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::Companies::Types::CountEntityKeysResponse.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
15 changes: 15 additions & 0 deletions lib/schematic/companies/types/count_entity_keys_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
# Input parameters
class CountEntityKeysParams < Internal::Types::Model
field :definition_id, -> { String }, optional: true, nullable: false
field :entity_type, -> { Schematic::Types::EntityType }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
end
end
end
end
14 changes: 14 additions & 0 deletions lib/schematic/companies/types/count_entity_keys_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Schematic
module Companies
module Types
class CountEntityKeysRequest < Internal::Types::Model
field :definition_id, -> { String }, optional: true, nullable: false
field :entity_type, -> { Schematic::Types::EntityType }, 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/companies/types/count_entity_keys_response.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
class CountEntityKeysResponse < Internal::Types::Model
field :data, -> { Schematic::Types::CountResponse }, optional: false, nullable: false
field :params, -> { Schematic::Companies::Types::CountEntityKeysParams }, 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 Companies
module Types
class DeleteEntityKeyDefinitionResponse < 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
2 changes: 1 addition & 1 deletion lib/schematic/types/billing_credit_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BillingCreditView < Internal::Types::Model
field :price, -> { Schematic::Types::BillingPriceView }, optional: true, nullable: false
field :price_per_unit, -> { Integer }, optional: true, nullable: false
field :price_per_unit_decimal, -> { String }, optional: true, nullable: false
field :product, -> { Schematic::Types::BillingProductResponseData }, optional: true, nullable: false
field :product, -> { Schematic::Types::BillingProductRecordResponseData }, optional: true, nullable: false
field :singular_name, -> { String }, optional: true, nullable: false
field :updated_at, -> { String }, optional: false, nullable: false
end
Expand Down
17 changes: 17 additions & 0 deletions lib/schematic/types/billing_product_record_response_data.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

module Schematic
module Types
class BillingProductRecordResponseData < Internal::Types::Model
field :account_id, -> { String }, optional: false, nullable: false
field :created_at, -> { String }, optional: false, nullable: false
field :environment_id, -> { String }, optional: false, nullable: false
field :external_id, -> { String }, optional: false, nullable: false
field :id, -> { String }, optional: false, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :name, -> { String }, optional: false, nullable: false
field :provider_type, -> { Schematic::Types::BillingProviderType }, optional: false, nullable: false
field :updated_at, -> { String }, optional: false, nullable: false
end
end
end
5 changes: 4 additions & 1 deletion lib/schematic/types/company_feature_usage_export_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ module Types
class CompanyFeatureUsageExportMetadata < Internal::Types::Model
field :company_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :credit_type_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :feature_ids, -> { Internal::Types::Array[String] }, optional: false, nullable: false
field :feature_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :has_scheduled_downgrade, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :monetized_subscriptions, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :notification_email_recipient_email_addresses, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :plan_id, -> { String }, optional: true, nullable: false
field :plan_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :plan_version_id, -> { String }, optional: true, nullable: false
field :q, -> { String }, optional: true, nullable: false
field :sort_order_column, -> { String }, optional: true, nullable: false
field :sort_order_direction, -> { Schematic::Types::CompanyFeatureUsageExportMetadataSortOrderDirection }, optional: true, nullable: false
field :subscription_statuses, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :subscription_types, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :visible_columns, -> { Internal::Types::Array[Schematic::Types::CompanyFeatureUsageExportMetadataVisibleColumnsItem] }, optional: true, nullable: false
field :with_entitlement_for, -> { String }, optional: true, nullable: false
field :with_subscription, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :without_feature_override_for, -> { String }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Schematic
module Types
module CompanyFeatureUsageExportMetadataSortOrderDirection
extend Schematic::Internal::Types::Enum

ASC = "asc"
DESC = "desc"
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

module Schematic
module Types
module CompanyFeatureUsageExportMetadataVisibleColumnsItem
extend Schematic::Internal::Types::Enum

PLAN = "plan"
SUBSCRIPTION = "subscription"
USERS = "users"
LAST_SEEN_AT = "last_seen_at"
end
end
end
1 change: 1 addition & 0 deletions lib/schematic/types/data_export_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class DataExportMetadata < Internal::Types::Model

member -> { Schematic::Types::AuditLogExportMetadata }, key: "AUDIT_LOG"
member -> { Schematic::Types::CompanyFeatureUsageExportMetadata }, key: "COMPANY_FEATURE_USAGE"
member -> { Schematic::Types::EventExportMetadata }, key: "EVENT"
end
end
end
1 change: 1 addition & 0 deletions lib/schematic/types/data_export_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module DataExportType

AUDIT_LOG = "audit-log"
COMPANY_FEATURE_USAGE = "company-feature-usage"
EVENT = "event"
end
end
end
16 changes: 16 additions & 0 deletions lib/schematic/types/event_export_metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

module Schematic
module Types
class EventExportMetadata < Internal::Types::Model
field :company_id, -> { String }, optional: true, nullable: false
field :end_time, -> { String }, optional: true, nullable: false
field :event_subtype, -> { String }, optional: true, nullable: false
field :event_types, -> { Internal::Types::Array[Schematic::Types::EventExportMetadataEventTypesItem] }, optional: true, nullable: false
field :flag_id, -> { String }, optional: true, nullable: false
field :notification_email_recipient_email_addresses, -> { Internal::Types::Array[String] }, optional: true, nullable: false
field :start_time, -> { String }, optional: true, nullable: false
field :user_id, -> { String }, optional: true, nullable: false
end
end
end
Loading