From 33c7db181c4e17195bec9b3f4f1f7f6d3df15477 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 25 May 2026 11:21:30 +0000 Subject: [PATCH] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-ruby-sdk: 1.1.13 --- .fern/metadata.json | 2 +- lib/schematic.rb | 8 + lib/schematic/billing/client.rb | 32 +++ ..._payment_method_by_external_id_response.rb | 12 + lib/schematic/credits/client.rb | 102 +++++++ .../acquire_credit_lease_request_body.rb | 14 + .../types/acquire_credit_lease_response.rb | 12 + .../types/extend_credit_lease_request_body.rb | 13 + .../types/extend_credit_lease_response.rb | 12 + .../types/release_credit_lease_response.rb | 12 + .../types/credit_lease_response_data.rb | 16 ++ lib/schematic/types/event_body_track.rb | 1 + lib/schematic/types/feature_view.rb | 1 + .../release_credit_lease_request_body.rb | 23 ++ reference.md | 250 ++++++++++++++++++ 15 files changed, 509 insertions(+), 1 deletion(-) create mode 100644 lib/schematic/billing/types/delete_payment_method_by_external_id_response.rb create mode 100644 lib/schematic/credits/types/acquire_credit_lease_request_body.rb create mode 100644 lib/schematic/credits/types/acquire_credit_lease_response.rb create mode 100644 lib/schematic/credits/types/extend_credit_lease_request_body.rb create mode 100644 lib/schematic/credits/types/extend_credit_lease_response.rb create mode 100644 lib/schematic/credits/types/release_credit_lease_response.rb create mode 100644 lib/schematic/types/credit_lease_response_data.rb create mode 100644 lib/schematic/types/release_credit_lease_request_body.rb diff --git a/.fern/metadata.json b/.fern/metadata.json index 57980af..a987ba7 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -13,6 +13,6 @@ "webrick": ">= 1.0" } }, - "originGitCommit": "3dc12b536625ca1efbb649f6c55df7da258c7e05", + "originGitCommit": "470e0f433ab9bb0e88784674fa2e1efce62ebd9b", "sdkVersion": "1.4.2" } \ No newline at end of file diff --git a/lib/schematic.rb b/lib/schematic.rb index 9d5d8fc..47c5d9a 100644 --- a/lib/schematic.rb +++ b/lib/schematic.rb @@ -104,6 +104,7 @@ require_relative "schematic/types/payment_method_response_data" require_relative "schematic/billing/types/list_payment_methods_response" require_relative "schematic/billing/types/upsert_payment_method_response" +require_relative "schematic/billing/types/delete_payment_method_by_external_id_response" require_relative "schematic/types/billing_price_usage_type" require_relative "schematic/types/billing_tiers_mode" require_relative "schematic/billing/types/list_billing_prices_params" @@ -174,6 +175,10 @@ require_relative "schematic/credits/types/count_billing_credits_grants_response" require_relative "schematic/credits/types/list_grants_for_credit_params" require_relative "schematic/credits/types/list_grants_for_credit_response" +require_relative "schematic/types/credit_lease_response_data" +require_relative "schematic/credits/types/acquire_credit_lease_response" +require_relative "schematic/credits/types/extend_credit_lease_response" +require_relative "schematic/credits/types/release_credit_lease_response" require_relative "schematic/types/credit_ledger_period" require_relative "schematic/credits/types/get_enriched_credit_ledger_params" require_relative "schematic/types/billing_credit_ledger_response_data" @@ -672,6 +677,7 @@ require_relative "schematic/types/plan_bundle_entitlement_request_body" require_relative "schematic/types/plan_currency_price_request_body" require_relative "schematic/types/proration_behavior" +require_relative "schematic/types/release_credit_lease_request_body" require_relative "schematic/types/rule_condition_group_response_data" require_relative "schematic/types/rule_condition_response_data" require_relative "schematic/types/rule_response_data" @@ -758,6 +764,8 @@ require_relative "schematic/credits/types/list_company_grants_request" require_relative "schematic/credits/types/count_billing_credits_grants_request" require_relative "schematic/credits/types/list_grants_for_credit_request" +require_relative "schematic/credits/types/acquire_credit_lease_request_body" +require_relative "schematic/credits/types/extend_credit_lease_request_body" require_relative "schematic/credits/types/get_enriched_credit_ledger_request" require_relative "schematic/credits/types/count_credit_ledger_request" require_relative "schematic/credits/types/list_billing_plan_credit_grants_request" diff --git a/lib/schematic/billing/client.rb b/lib/schematic/billing/client.rb index 40ea94a..9309574 100644 --- a/lib/schematic/billing/client.rb +++ b/lib/schematic/billing/client.rb @@ -442,6 +442,38 @@ def upsert_payment_method(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] :billing_id + # + # @return [Schematic::Billing::Types::DeletePaymentMethodByExternalIdResponse] + def delete_payment_method_by_external_id(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: "billing/payment-methods/#{URI.encode_uri_component(params[:billing_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::Billing::Types::DeletePaymentMethodByExternalIdResponse.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 diff --git a/lib/schematic/billing/types/delete_payment_method_by_external_id_response.rb b/lib/schematic/billing/types/delete_payment_method_by_external_id_response.rb new file mode 100644 index 0000000..ba0031a --- /dev/null +++ b/lib/schematic/billing/types/delete_payment_method_by_external_id_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Billing + module Types + class DeletePaymentMethodByExternalIdResponse < 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 diff --git a/lib/schematic/credits/client.rb b/lib/schematic/credits/client.rb index 598997c..0f48cd9 100644 --- a/lib/schematic/credits/client.rb +++ b/lib/schematic/credits/client.rb @@ -747,6 +747,108 @@ def list_grants_for_credit(request_options: {}, **params) end end + # @param request_options [Hash] + # @param params [Schematic::Credits::Types::AcquireCreditLeaseRequestBody] + # @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 + # + # @return [Schematic::Credits::Types::AcquireCreditLeaseResponse] + def acquire_credit_lease(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "billing/credits/lease", + body: Schematic::Credits::Types::AcquireCreditLeaseRequestBody.new(params).to_h, + 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::Credits::Types::AcquireCreditLeaseResponse.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::Credits::Types::ExtendCreditLeaseRequestBody] + # @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] :lease_id + # + # @return [Schematic::Credits::Types::ExtendCreditLeaseResponse] + def extend_credit_lease(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request_data = Schematic::Credits::Types::ExtendCreditLeaseRequestBody.new(params).to_h + non_body_param_names = ["lease_id"] + body = request_data.except(*non_body_param_names) + + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PUT", + path: "billing/credits/lease/#{URI.encode_uri_component(params[:lease_id].to_s)}/extend", + 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::Credits::Types::ExtendCreditLeaseResponse.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::ReleaseCreditLeaseRequestBody] + # @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] :lease_id + # + # @return [Schematic::Credits::Types::ReleaseCreditLeaseResponse] + def release_credit_lease(request_options: {}, **params) + params = Schematic::Internal::Types::Utils.normalize_keys(params) + request = Schematic::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PUT", + path: "billing/credits/lease/#{URI.encode_uri_component(params[:lease_id].to_s)}/release", + body: 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::Credits::Types::ReleaseCreditLeaseResponse.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 diff --git a/lib/schematic/credits/types/acquire_credit_lease_request_body.rb b/lib/schematic/credits/types/acquire_credit_lease_request_body.rb new file mode 100644 index 0000000..e873797 --- /dev/null +++ b/lib/schematic/credits/types/acquire_credit_lease_request_body.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Schematic + module Credits + module Types + class AcquireCreditLeaseRequestBody < Internal::Types::Model + field :company_id, -> { String }, optional: false, nullable: false + field :credit_type_id, -> { String }, optional: false, nullable: false + field :expires_at, -> { String }, optional: true, nullable: false + field :requested_amount, -> { Integer }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/credits/types/acquire_credit_lease_response.rb b/lib/schematic/credits/types/acquire_credit_lease_response.rb new file mode 100644 index 0000000..56e8825 --- /dev/null +++ b/lib/schematic/credits/types/acquire_credit_lease_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Credits + module Types + class AcquireCreditLeaseResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CreditLeaseResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/credits/types/extend_credit_lease_request_body.rb b/lib/schematic/credits/types/extend_credit_lease_request_body.rb new file mode 100644 index 0000000..d8ac230 --- /dev/null +++ b/lib/schematic/credits/types/extend_credit_lease_request_body.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Schematic + module Credits + module Types + class ExtendCreditLeaseRequestBody < Internal::Types::Model + field :lease_id, -> { String }, optional: false, nullable: false + field :additional_amount, -> { Integer }, optional: false, nullable: false + field :expires_at, -> { String }, optional: true, nullable: false + end + end + end +end diff --git a/lib/schematic/credits/types/extend_credit_lease_response.rb b/lib/schematic/credits/types/extend_credit_lease_response.rb new file mode 100644 index 0000000..df70a66 --- /dev/null +++ b/lib/schematic/credits/types/extend_credit_lease_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Credits + module Types + class ExtendCreditLeaseResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CreditLeaseResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/credits/types/release_credit_lease_response.rb b/lib/schematic/credits/types/release_credit_lease_response.rb new file mode 100644 index 0000000..07ed352 --- /dev/null +++ b/lib/schematic/credits/types/release_credit_lease_response.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Schematic + module Credits + module Types + class ReleaseCreditLeaseResponse < Internal::Types::Model + field :data, -> { Schematic::Types::CreditLeaseResponseData }, optional: false, nullable: false + field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end +end diff --git a/lib/schematic/types/credit_lease_response_data.rb b/lib/schematic/types/credit_lease_response_data.rb new file mode 100644 index 0000000..48a9f2d --- /dev/null +++ b/lib/schematic/types/credit_lease_response_data.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Schematic + module Types + class CreditLeaseResponseData < Internal::Types::Model + field :company_id, -> { String }, optional: false, nullable: false + field :created_at, -> { String }, optional: false, nullable: false + field :credit_type_id, -> { String }, optional: false, nullable: false + field :expires_at, -> { String }, optional: false, nullable: false + field :granted_amount, -> { Integer }, optional: false, nullable: false + field :id, -> { String }, optional: false, nullable: false + field :released_at, -> { String }, optional: true, nullable: false + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/schematic/types/event_body_track.rb b/lib/schematic/types/event_body_track.rb index e26f350..a1bf9ce 100644 --- a/lib/schematic/types/event_body_track.rb +++ b/lib/schematic/types/event_body_track.rb @@ -5,6 +5,7 @@ module Types class EventBodyTrack < Internal::Types::Model field :company, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false field :event, -> { String }, optional: false, nullable: false + field :lease_id, -> { String }, optional: true, nullable: false field :quantity, -> { Integer }, optional: true, nullable: false field :traits, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false field :user, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false diff --git a/lib/schematic/types/feature_view.rb b/lib/schematic/types/feature_view.rb index 7fc5e66..9f0e079 100644 --- a/lib/schematic/types/feature_view.rb +++ b/lib/schematic/types/feature_view.rb @@ -21,6 +21,7 @@ class FeatureView < Internal::Types::Model field :trait, -> { Schematic::Types::EntityTraitDefinitionResponseData }, optional: true, nullable: false field :trait_id, -> { String }, optional: true, nullable: false field :updated_at, -> { String }, optional: false, nullable: false + field :usage_limit_trait_id, -> { String }, optional: true, nullable: false end end end diff --git a/lib/schematic/types/release_credit_lease_request_body.rb b/lib/schematic/types/release_credit_lease_request_body.rb new file mode 100644 index 0000000..5d17389 --- /dev/null +++ b/lib/schematic/types/release_credit_lease_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Schematic + module Types + module ReleaseCreditLeaseRequestBody + # ReleaseCreditLeaseRequestBody is an alias for Hash + + # @option str [String] + # + # @return [untyped] + def self.load(str) + ::JSON.parse(str) + end + + # @option value [untyped] + # + # @return [String] + def self.dump(value) + ::JSON.generate(value) + end + end + end +end diff --git a/reference.md b/reference.md index b7940e0..c264cf1 100644 --- a/reference.md +++ b/reference.md @@ -2230,6 +2230,54 @@ client.billing.upsert_payment_method( + + + + +
client.billing.delete_payment_method_by_external_id(billing_id) -> Schematic::Billing::Types::DeletePaymentMethodByExternalIdResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.billing.delete_payment_method_by_external_id(billing_id: "billing_id") +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**billing_id:** `String` — billing_id + +
+
+ +
+
+ +**request_options:** `Schematic::Billing::RequestOptions` + +
+
+
+
+ +
@@ -5175,6 +5223,208 @@ client.credits.list_grants_for_credit( + + + + +
client.credits.acquire_credit_lease(request) -> Schematic::Credits::Types::AcquireCreditLeaseResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.credits.acquire_credit_lease( + company_id: "company_id", + credit_type_id: "credit_type_id", + requested_amount: 1.1 +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**company_id:** `String` + +
+
+ +
+
+ +**credit_type_id:** `String` + +
+
+ +
+
+ +**expires_at:** `String` + +
+
+ +
+
+ +**requested_amount:** `Integer` + +
+
+ +
+
+ +**request_options:** `Schematic::Credits::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.credits.extend_credit_lease(lease_id, request) -> Schematic::Credits::Types::ExtendCreditLeaseResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.credits.extend_credit_lease( + lease_id: "lease_id", + additional_amount: 1.1 +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**lease_id:** `String` — lease_id + +
+
+ +
+
+ +**additional_amount:** `Integer` + +
+
+ +
+
+ +**expires_at:** `String` + +
+
+ +
+
+ +**request_options:** `Schematic::Credits::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.credits.release_credit_lease(lease_id, request) -> Schematic::Credits::Types::ReleaseCreditLeaseResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.credits.release_credit_lease( + lease_id: "lease_id", + request: {} +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**lease_id:** `String` — lease_id + +
+
+ +
+
+ +**request:** `Internal::Types::Hash[String, Object]` + +
+
+ +
+
+ +**request_options:** `Schematic::Credits::RequestOptions` + +
+
+
+
+ +