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
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"webrick": ">= 1.0"
}
},
"originGitCommit": "786b643cc0bf17aff1114597108246b5cf8af395",
"originGitCommit": "df83a2723a19055c70199e3b0b78b77e9c394838",
"sdkVersion": "1.4.5"
}
328 changes: 21 additions & 307 deletions .fern/replay.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/schematic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@
require_relative "schematic/features/types/update_flag_rules_response"
require_relative "schematic/types/check_flag_response_data"
require_relative "schematic/features/types/check_flag_response"
require_relative "schematic/types/company_credit_balance"
require_relative "schematic/types/trial_status"
require_relative "schematic/types/datastream_company_plan"
require_relative "schematic/types/check_flags_response_data"
Expand Down
8 changes: 6 additions & 2 deletions lib/schematic/billing/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ def delete_payment_method_by_external_id(request_options: {}, **params)
# @option params [String, nil] :ids
# @option params [String, nil] :interval
# @option params [Boolean, nil] :is_active
# @option params [String, nil] :plan_version_id
# @option params [Integer, nil] :price
# @option params [String, nil] :product_id
# @option params [String, nil] :product_ids
Expand All @@ -501,14 +502,15 @@ def delete_payment_method_by_external_id(request_options: {}, **params)
# @return [Schematic::Billing::Types::ListBillingPricesResponse]
def list_billing_prices(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_params = {}
query_params["currency"] = params[:currency] if params.key?(:currency)
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["interval"] = params[:interval] if params.key?(:interval)
query_params["is_active"] = params[:is_active] if params.key?(:is_active)
query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
query_params["price"] = params[:price] if params.key?(:price)
query_params["product_id"] = params[:product_id] if params.key?(:product_id)
query_params["product_ids"] = params[:product_ids] if params.key?(:product_ids)
Expand Down Expand Up @@ -619,6 +621,7 @@ def delete_billing_product(request_options: {}, **params)
# @option params [String, nil] :ids
# @option params [String, nil] :interval
# @option params [Boolean, nil] :is_active
# @option params [String, nil] :plan_version_id
# @option params [Integer, nil] :price
# @option params [String, nil] :product_id
# @option params [String, nil] :product_ids
Expand All @@ -633,14 +636,15 @@ def delete_billing_product(request_options: {}, **params)
# @return [Schematic::Billing::Types::ListBillingProductPricesResponse]
def list_billing_product_prices(request_options: {}, **params)
params = Schematic::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_param_names = %i[currency for_initial_plan for_trial_expiry_plan ids interval is_active plan_version_id price product_id product_ids provider_type q tiers_mode usage_type with_meter limit offset]
query_params = {}
query_params["currency"] = params[:currency] if params.key?(:currency)
query_params["for_initial_plan"] = params[:for_initial_plan] if params.key?(:for_initial_plan)
query_params["for_trial_expiry_plan"] = params[:for_trial_expiry_plan] if params.key?(:for_trial_expiry_plan)
query_params["ids"] = params[:ids] if params.key?(:ids)
query_params["interval"] = params[:interval] if params.key?(:interval)
query_params["is_active"] = params[:is_active] if params.key?(:is_active)
query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id)
query_params["price"] = params[:price] if params.key?(:price)
query_params["product_id"] = params[:product_id] if params.key?(:product_id)
query_params["product_ids"] = params[:product_ids] if params.key?(:product_ids)
Expand Down
1 change: 1 addition & 0 deletions lib/schematic/billing/types/list_billing_prices_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ListBillingPricesParams < Internal::Types::Model
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
field :plan_version_id, -> { String }, optional: true, nullable: false
field :price, -> { Integer }, optional: true, nullable: false
field :product_id, -> { String }, optional: true, nullable: false
field :product_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
Expand Down
1 change: 1 addition & 0 deletions lib/schematic/billing/types/list_billing_prices_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ListBillingPricesRequest < Internal::Types::Model
field :ids, -> { String }, optional: true, nullable: false
field :interval, -> { String }, optional: true, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :plan_version_id, -> { String }, optional: true, nullable: false
field :price, -> { Integer }, optional: true, nullable: false
field :product_id, -> { String }, optional: true, nullable: false
field :product_ids, -> { String }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ListBillingProductPricesParams < Internal::Types::Model
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :limit, -> { Integer }, optional: true, nullable: false
field :offset, -> { Integer }, optional: true, nullable: false
field :plan_version_id, -> { String }, optional: true, nullable: false
field :price, -> { Integer }, optional: true, nullable: false
field :product_id, -> { String }, optional: true, nullable: false
field :product_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ListBillingProductPricesRequest < Internal::Types::Model
field :ids, -> { String }, optional: true, nullable: false
field :interval, -> { String }, optional: true, nullable: false
field :is_active, -> { Internal::Types::Boolean }, optional: true, nullable: false
field :plan_version_id, -> { String }, optional: true, nullable: false
field :price, -> { Integer }, optional: true, nullable: false
field :product_id, -> { String }, optional: true, nullable: false
field :product_ids, -> { String }, optional: true, nullable: false
Expand Down
7 changes: 3 additions & 4 deletions lib/schematic/datastream/merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def partial_company(existing, partial_data)
end
end

if (updated_balances&.any? || metrics_updated) && !entitlements_in_partial
if (updated_balances || metrics_updated) && !entitlements_in_partial
result[:entitlements] = sync_entitlements(
result[:entitlements], result[:metrics], updated_balances, metrics_updated
)
Expand Down Expand Up @@ -152,9 +152,8 @@ def sync_entitlements(entitlements, metrics, updated_balances, metrics_updated)
end
end

# The partial's credit_balances may be keyed by string or symbol depending
# on how the message was parsed, while an entitlement's credit_id is a
# string value, so check both key forms.
# credit_balances keys may be symbols (deep_copy symbolizes) while an
# entitlement's credit_id is always a string, so check both forms.
def fetch_balance(balances, credit_id)
return [true, balances[credit_id]] if balances.key?(credit_id)
return [true, balances[credit_id.to_sym]] if balances.key?(credit_id.to_sym)
Expand Down
1 change: 0 additions & 1 deletion lib/schematic/types/account_member_permission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module Types
module AccountMemberPermission
extend Schematic::Internal::Types::Enum

BILLING_CREDITS_EDIT = "billing_credits_edit"
COMPANIES_EDIT = "companies_edit"
COMPANY_USERS_EDIT = "company_users_edit"
COMPONENTS_EDIT = "components_edit"
Expand Down
1 change: 1 addition & 0 deletions lib/schematic/types/check_flags_response_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Schematic
module Types
class CheckFlagsResponseData < Internal::Types::Model
field :credit_balances, -> { Internal::Types::Hash[String, Schematic::Types::CompanyCreditBalance] }, optional: true, nullable: false
field :flags, -> { Internal::Types::Array[Schematic::Types::CheckFlagResponseData] }, optional: false, nullable: false
field :plan, -> { Schematic::Types::DatastreamCompanyPlan }, optional: true, nullable: false
end
Expand Down
11 changes: 11 additions & 0 deletions lib/schematic/types/company_credit_balance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Schematic
module Types
class CompanyCreditBalance < Internal::Types::Model
field :remaining, -> { Integer }, optional: false, nullable: false
field :reserved, -> { Integer }, optional: false, nullable: false
field :settled, -> { Integer }, optional: false, nullable: false
end
end
end
1 change: 1 addition & 0 deletions lib/schematic/types/company_subscription_response_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class CompanySubscriptionResponseData < Internal::Types::Model
field :discounts, -> { Internal::Types::Array[Schematic::Types::BillingSubscriptionDiscountView] }, optional: false, nullable: false
field :expired_at, -> { String }, optional: true, nullable: false
field :interval, -> { String }, optional: false, nullable: false
field :is_initial, -> { Internal::Types::Boolean }, optional: false, nullable: false
field :latest_invoice, -> { Schematic::Types::InvoiceResponseData }, optional: true, nullable: false
field :payment_method, -> { Schematic::Types::PaymentMethodResponseData }, optional: true, nullable: false
field :products, -> { Internal::Types::Array[Schematic::Types::BillingProductForSubscriptionResponseData] }, optional: false, nullable: false
Expand Down
2 changes: 2 additions & 0 deletions lib/schematic/types/feature_entitlement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ module Schematic
module Types
class FeatureEntitlement < Internal::Types::Model
field :allocation, -> { Integer }, optional: true, nullable: false
field :consumption_rate, -> { Integer }, optional: true, nullable: false
field :credit_id, -> { String }, optional: true, nullable: false
field :credit_remaining, -> { Integer }, optional: true, nullable: false
field :credit_reserved, -> { Integer }, optional: true, nullable: false
field :credit_settled, -> { Integer }, optional: true, nullable: false
field :credit_total, -> { Integer }, optional: true, nullable: false
field :credit_used, -> { Integer }, optional: true, nullable: false
field :event_name, -> { String }, optional: true, nullable: false
field :event_subtype, -> { String }, optional: true, nullable: false
field :feature_id, -> { String }, optional: false, nullable: false
field :feature_key, -> { String }, optional: false, nullable: false
field :metric_period, -> { Schematic::Types::MetricPeriod }, optional: true, nullable: false
Expand Down
2 changes: 2 additions & 0 deletions lib/schematic/types/rulesengine_feature_entitlement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ module Schematic
module Types
class RulesengineFeatureEntitlement < Internal::Types::Model
field :allocation, -> { Integer }, optional: true, nullable: false
field :consumption_rate, -> { Integer }, optional: true, nullable: false
field :credit_id, -> { String }, optional: true, nullable: false
field :credit_remaining, -> { Integer }, optional: true, nullable: false
field :credit_reserved, -> { Integer }, optional: true, nullable: false
field :credit_settled, -> { Integer }, optional: true, nullable: false
field :credit_total, -> { Integer }, optional: true, nullable: false
field :credit_used, -> { Integer }, optional: true, nullable: false
field :event_name, -> { String }, optional: true, nullable: false
field :event_subtype, -> { String }, optional: true, nullable: false
field :feature_id, -> { String }, optional: false, nullable: false
field :feature_key, -> { String }, optional: false, nullable: false
field :metric_period, -> { Schematic::Types::RulesengineMetricPeriod }, optional: true, nullable: false
Expand Down
18 changes: 18 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2419,6 +2419,7 @@ client.billing.list_billing_prices(
ids: ["ids"],
interval: "interval",
is_active: true,
plan_version_id: "plan_version_id",
price: 1000000,
product_id: "product_id",
product_ids: ["product_ids"],
Expand Down Expand Up @@ -2492,6 +2493,14 @@ client.billing.list_billing_prices(
<dl>
<dd>

**plan_version_id:** `String` — Filter for prices belonging to a specific plan version (e.g. the latest published version)

</dd>
</dl>

<dl>
<dd>

**price:** `Integer`

</dd>
Expand Down Expand Up @@ -2841,6 +2850,7 @@ client.billing.list_billing_product_prices(
ids: ["ids"],
interval: "interval",
is_active: true,
plan_version_id: "plan_version_id",
price: 1000000,
product_id: "product_id",
product_ids: ["product_ids"],
Expand Down Expand Up @@ -2914,6 +2924,14 @@ client.billing.list_billing_product_prices(
<dl>
<dd>

**plan_version_id:** `String` — Filter for prices belonging to a specific plan version (e.g. the latest published version)

</dd>
</dl>

<dl>
<dd>

**price:** `Integer`

</dd>
Expand Down